window.JSON || (window.JSON = {}),
function() {
	function f(a) {
		return a < 10 ? "0" + a: a
	}
	function quote(a) {
		return escapable.lastIndex = 0,
		escapable.test(a) ? '"' + a.replace(escapable,
		function(a) {
			var b = meta[a];
			return typeof b == "string" ? b: "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice( - 4)
		}) + '"': '"' + a + '"'
	}
	function str(a, b) {
		var c, d, e, f, g = gap,
		h, i = b[a];
		i && typeof i == "object" && typeof i.toJSON == "function" && (i = i.toJSON(a)),
		typeof rep == "function" && (i = rep.call(b, a, i));
		switch (typeof i) {
		case "string":
			return quote(i);
		case "number":
			return isFinite(i) ? String(i) : "null";
		case "boolean":
		case "null":
			return String(i);
		case "object":
			if (!i) return "null";
			gap += indent,
			h = [];
			if (Object.prototype.toString.apply(i) === "[object Array]") {
				f = i.length;
				for (c = 0; c < f; c += 1) h[c] = str(c, i) || "null";
				return e = h.length === 0 ? "[]": gap ? "[\n" + gap + h.join(",\n" + gap) + "\n" + g + "]": "[" + h.join(",") + "]",
				gap = g,
				e
			}
			if (rep && typeof rep == "object") {
				f = rep.length;
				for (c = 0; c < f; c += 1) d = rep[c],
				typeof d == "string" && (e = str(d, i), e && h.push(quote(d) + (gap ? ": ": ":") + e))
			} else for (d in i) Object.hasOwnProperty.call(i, d) && (e = str(d, i), e && h.push(quote(d) + (gap ? ": ": ":") + e));
			return e = h.length === 0 ? "{}": gap ? "{\n" + gap + h.join(",\n" + gap) + "\n" + g + "}": "{" + h.join(",") + "}",
			gap = g,
			e
		}
	}
	"use strict",
	typeof Date.prototype.toJSON != "function" && (Date.prototype.toJSON = function(a) {
		return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z": null
	},
	String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(a) {
		return this.valueOf()
	});
	var JSON = window.JSON,
	cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
	escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
	gap, indent, meta = {
		"\b": "\\b",
		"\t": "\\t",
		"\n": "\\n",
		"\f": "\\f",
		"\r": "\\r",
		'"': '\\"',
		"\\": "\\\\"
	},
	rep;
	typeof JSON.stringify != "function" && (JSON.stringify = function(a, b, c) {
		var d;
		gap = "",
		indent = "";
		if (typeof c == "number") for (d = 0; d < c; d += 1) indent += " ";
		else typeof c == "string" && (indent = c);
		rep = b;
		if (!b || typeof b == "function" || typeof b == "object" && typeof b.length == "number") return str("", {
			"": a
		});
		throw new Error("JSON.stringify")
	}),
	typeof JSON.parse != "function" && (JSON.parse = function(text, reviver) {
		function walk(a, b) {
			var c, d, e = a[b];
			if (e && typeof e == "object") for (c in e) Object.hasOwnProperty.call(e, c) && (d = walk(e, c), d !== undefined ? e[c] = d: delete e[c]);
			return reviver.call(a, b, e)
		}
		var j;
		text = String(text),
		cx.lastIndex = 0,
		cx.test(text) && (text = text.replace(cx,
		function(a) {
			return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice( - 4)
		}));
		if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" + text + ")"),
		typeof reviver == "function" ? walk({
			"": j
		},
		"") : j;
		throw new SyntaxError("JSON.parse")
	})
} (),
function(a, b) {
	"use strict";
	var c = a.History = a.History || {},
	d = a.MooTools,
	e = a.Element;
	if (typeof c.Adapter != "undefined") throw new Error("History.js Adapter has already been loaded...");
	Object.append(e.NativeEvents, {
		popstate: 2,
		hashchange: 2
	}),
	c.Adapter = {
		bind: function(a, b, c) {
			var d = typeof a == "string" ? document.id(a) : a;
			d.addEvent(b, c)
		},
		trigger: function(a, b, c) {
			var d = typeof a == "string" ? document.id(a) : a;
			d.fireEvent(b, c)
		},
		extractEventData: function(a, c) {
			var d = c && c.event && c.event[a] || c && c[a] || b;
			return d
		},
		onDomLoad: function(b) {
			a.addEvent("domready", b)
		}
	},
	typeof c.init != "undefined" && c.init()
} (window),
function(a, b) {
	"use strict";
	var c = a.document,
	d = a.setTimeout || d,
	e = a.clearTimeout || e,
	f = a.setInterval || f,
	g = a.History = a.History || {};
	if (typeof g.initHtml4 != "undefined") throw new Error("History.js HTML4 Support has already been loaded...");
	g.initHtml4 = function() {
		if (typeof g.initHtml4.initialized != "undefined") return ! 1;
		g.initHtml4.initialized = !0,
		g.enabled = !0,
		g.savedHashes = [],
		g.isLastHash = function(a) {
			var b = g.getHashByIndex(),
			c;
			return c = a === b,
			c
		},
		g.saveHash = function(a) {
			return g.isLastHash(a) ? !1 : (g.savedHashes.push(a), !0)
		},
		g.getHashByIndex = function(a) {
			var b = null;
			return typeof a == "undefined" ? b = g.savedHashes[g.savedHashes.length - 1] : a < 0 ? b = g.savedHashes[g.savedHashes.length + a] : b = g.savedHashes[a],
			b
		},
		g.discardedHashes = {},
		g.discardedStates = {},
		g.discardState = function(a, b, c) {
			var d = g.getHashByState(a),
			e;
			return e = {
				discardedState: a,
				backState: c,
				forwardState: b
			},
			g.discardedStates[d] = e,
			!0
		},
		g.discardHash = function(a, b, c) {
			var d = {
				discardedHash: a,
				backState: c,
				forwardState: b
			};
			return g.discardedHashes[a] = d,
			!0
		},
		g.discardedState = function(a) {
			var b = g.getHashByState(a),
			c;
			return c = g.discardedStates[b] || !1,
			c
		},
		g.discardedHash = function(a) {
			var b = g.discardedHashes[a] || !1;
			return b
		},
		g.recycleState = function(a) {
			var b = g.getHashByState(a);
			return g.discardedState(a) && delete g.discardedStates[b],
			!0
		},
		g.emulated.hashChange && (g.hashChangeInit = function() {
			g.checkerFunction = null;
			var b = "",
			d, e, h, i;
			return g.isInternetExplorer() ? (d = "historyjs-iframe", e = c.createElement("iframe"), e.setAttribute("id", d), e.style.display = "none", c.body.appendChild(e), e.contentWindow.document.open(), e.contentWindow.document.close(), h = "", i = !1, g.checkerFunction = function() {
				if (i) return ! 1;
				i = !0;
				var c = g.getHash() || "",
				d = g.unescapeHash(e.contentWindow.document.location.hash) || "";
				return c !== b ? (b = c, d !== c && (h = d = c, e.contentWindow.document.open(), e.contentWindow.document.close(), e.contentWindow.document.location.hash = g.escapeHash(c)), g.Adapter.trigger(a, "hashchange")) : d !== h && (h = d, g.setHash(d, !1)),
				i = !1,
				!0
			}) : g.checkerFunction = function() {
				var c = g.getHash();
				return c !== b && (b = c, g.Adapter.trigger(a, "hashchange")),
				!0
			},
			g.intervalList.push(f(g.checkerFunction, g.options.hashChangeInterval)),
			!0
		},
		g.Adapter.onDomLoad(g.hashChangeInit)),
		g.emulated.pushState && (g.onHashChange = function(b) {
			var d = b && b.newURL || c.location.href,
			e = g.getHashByUrl(d),
			f = null,
			h = null,
			i = null,
			j;
			return g.isLastHash(e) ? (g.busy(!1), !1) : (g.doubleCheckComplete(), g.saveHash(e), e && g.isTraditionalAnchor(e) ? (g.Adapter.trigger(a, "anchorchange"), g.busy(!1), !1) : (f = g.extractState(g.getFullUrl(e || c.location.href, !1), !0), g.isLastSavedState(f) ? (g.busy(!1), !1) : (h = g.getHashByState(f), j = g.discardedState(f), j ? (g.getHashByIndex( - 2) === g.getHashByState(j.forwardState) ? g.back(!1) : g.forward(!1), !1) : (g.pushState(f.data, f.title, f.url, !1), !0))))
		},
		g.Adapter.bind(a, "hashchange", g.onHashChange), g.pushState = function(b, d, e, f) {
			if (g.getHashByUrl(e)) throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");
			if (f !== !1 && g.busy()) return g.pushQueue({
				scope: g,
				callback: g.pushState,
				args: arguments,
				queue: f
			}),
			!1;
			g.busy(!0);
			var h = g.createStateObject(b, d, e),
			i = g.getHashByState(h),
			j = g.getState(!1),
			k = g.getHashByState(j),
			l = g.getHash();
			return g.storeState(h),
			g.expectedStateId = h.id,
			g.recycleState(h),
			g.setTitle(h),
			i === k ? (g.busy(!1), !1) : i !== l && i !== g.getShortUrl(c.location.href) ? (g.setHash(i, !1), !1) : (g.saveState(h), g.Adapter.trigger(a, "statechange"), g.busy(!1), !0)
		},
		g.replaceState = function(a, b, c, d) {
			if (g.getHashByUrl(c)) throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");
			if (d !== !1 && g.busy()) return g.pushQueue({
				scope: g,
				callback: g.replaceState,
				args: arguments,
				queue: d
			}),
			!1;
			g.busy(!0);
			var e = g.createStateObject(a, b, c),
			f = g.getState(!1),
			h = g.getStateByIndex( - 2);
			return g.discardState(f, e, h),
			g.pushState(e.data, e.title, e.url, !1),
			!0
		}),
		g.emulated.pushState && g.getHash() && !g.emulated.hashChange && g.Adapter.onDomLoad(function() {
			g.Adapter.trigger(a, "hashchange")
		})
	},
	typeof g.init != "undefined" && g.init()
} (window),
function(a, b) {
	"use strict";
	var c = a.console || b,
	d = a.document,
	e = a.navigator,
	f = a.sessionStorage || !1,
	g = a.setTimeout,
	h = a.clearTimeout,
	i = a.setInterval,
	j = a.clearInterval,
	k = a.JSON,
	l = a.alert,
	m = a.History = a.History || {},
	n = a.history;
	k.stringify = k.stringify || k.encode,
	k.parse = k.parse || k.decode;
	if (typeof m.init != "undefined") throw new Error("History.js Core has already been loaded...");
	m.init = function() {
		return typeof m.Adapter == "undefined" ? !1 : (typeof m.initCore != "undefined" && m.initCore(), typeof m.initHtml4 != "undefined" && m.initHtml4(), !0)
	},
	m.initCore = function() {
		if (typeof m.initCore.initialized != "undefined") return ! 1;
		m.initCore.initialized = !0,
		m.options = m.options || {},
		m.options.hashChangeInterval = m.options.hashChangeInterval || 100,
		m.options.safariPollInterval = m.options.safariPollInterval || 500,
		m.options.doubleCheckInterval = m.options.doubleCheckInterval || 500,
		m.options.storeInterval = m.options.storeInterval || 1e3,
		m.options.busyDelay = m.options.busyDelay || 250,
		m.options.debug = m.options.debug || !1,
		m.options.initialTitle = m.options.initialTitle || d.title,
		m.intervalList = [],
		m.clearAllIntervals = function() {
			var a, b = m.intervalList;
			if (typeof b != "undefined" && b !== null) {
				for (a = 0; a < b.length; a++) j(b[a]);
				m.intervalList = null
			}
		},
		m.debug = function() { (m.options.debug || !1) && m.log.apply(m, arguments)
		},
		m.log = function() {
			var a = typeof c != "undefined" && typeof c.log != "undefined" && typeof c.log.apply != "undefined",
			b = d.getElementById("log"),
			e,
			f,
			g,
			h,
			i;
			a ? (h = Array.prototype.slice.call(arguments), e = h.shift(), typeof c.debug != "undefined" ? c.debug.apply(c, [e, h]) : c.log.apply(c, [e, h])) : e = "\n" + arguments[0] + "\n";
			for (f = 1, g = arguments.length; f < g; ++f) {
				i = arguments[f];
				if (typeof i == "object" && typeof k != "undefined") try {
					i = k.stringify(i)
				} catch(j) {}
				e += "\n" + i + "\n"
			}
			return b ? (b.value += e + "\n-----\n", b.scrollTop = b.scrollHeight - b.clientHeight) : a || l(e),
			!0
		},
		m.getInternetExplorerMajorVersion = function() {
			var a = m.getInternetExplorerMajorVersion.cached = typeof m.getInternetExplorerMajorVersion.cached != "undefined" ? m.getInternetExplorerMajorVersion.cached: function() {
				var a = 3,
				b = d.createElement("div"),
				c = b.getElementsByTagName("i");
				while ((b.innerHTML = "<!--[if gt IE " + ++a + "]><i></i><![endif]-->") && c[0]);
				return a > 4 ? a: !1
			} ();
			return a
		},
		m.isInternetExplorer = function() {
			var a = m.isInternetExplorer.cached = typeof m.isInternetExplorer.cached != "undefined" ? m.isInternetExplorer.cached: Boolean(m.getInternetExplorerMajorVersion());
			return a
		},
		m.emulated = {
			pushState: !Boolean(a.history && a.history.pushState && a.history.replaceState && !/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent) && !/AppleWebKit\/5([0-2]|3[0-2])/i.test(e.userAgent)),
			hashChange: Boolean(!("onhashchange" in a || "onhashchange" in d) || m.isInternetExplorer() && m.getInternetExplorerMajorVersion() < 8)
		},
		m.enabled = !m.emulated.pushState,
		m.bugs = {
			setHash: Boolean(!m.emulated.pushState && e.vendor === "Apple Computer, Inc." && /AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),
			safariPoll: Boolean(!m.emulated.pushState && e.vendor === "Apple Computer, Inc." && /AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),
			ieDoubleCheck: Boolean(m.isInternetExplorer() && m.getInternetExplorerMajorVersion() < 8),
			hashEscape: Boolean(m.isInternetExplorer() && m.getInternetExplorerMajorVersion() < 7)
		},
		m.isEmptyObject = function(a) {
			for (var b in a) return ! 1;
			return ! 0
		},
		m.cloneObject = function(a) {
			var b, c;
			return a ? (b = k.stringify(a), c = k.parse(b)) : c = {},
			c
		},
		m.getRootUrl = function() {
			var a = d.location.protocol + "//" + (d.location.hostname || d.location.host);
			if (d.location.port || !1) a += ":" + d.location.port;
			return a += "/",
			a
		},
		m.getBaseHref = function() {
			var a = d.getElementsByTagName("base"),
			b = null,
			c = "";
			return a.length === 1 && (b = a[0], c = b.href.replace(/[^\/]+$/, "")),
			c = c.replace(/\/+$/, ""),
			c && (c += "/"),
			c
		},
		m.getBaseUrl = function() {
			var a = m.getBaseHref() || m.getBasePageUrl() || m.getRootUrl();
			return a
		},
		m.getPageUrl = function() {
			var a = m.getState(!1, !1),
			b = (a || {}).url || d.location.href,
			c;
			return c = b.replace(/\/+$/, "").replace(/[^\/]+$/,
			function(a, b, c) {
				return /\./.test(a) ? a: a + "/"
			}),
			c
		},
		m.getBasePageUrl = function() {
			var a = d.location.href.replace(/[#\?].*/, "").replace(/[^\/]+$/,
			function(a, b, c) {
				return /[^\/]$/.test(a) ? "": a
			}).replace(/\/+$/, "") + "/";
			return a
		},
		m.getFullUrl = function(a, b) {
			var c = a,
			d = a.substring(0, 1);
			return b = typeof b == "undefined" ? !0 : b,
			/[a-z]+\:\/\//.test(a) || (d === "/" ? c = m.getRootUrl() + a.replace(/^\/+/, "") : d === "#" ? c = m.getPageUrl().replace(/#.*/, "") + a: d === "?" ? c = m.getPageUrl().replace(/[\?#].*/, "") + a: b ? c = m.getBaseUrl() + a.replace(/^(\.\/)+/, "") : c = m.getBasePageUrl() + a.replace(/^(\.\/)+/, "")),
			c.replace(/\#$/, "")
		},
		m.getShortUrl = function(a) {
			var b = a,
			c = m.getBaseUrl(),
			d = m.getRootUrl();
			return m.emulated.pushState && (b = b.replace(c, "")),
			b = b.replace(d, "/"),
			m.isTraditionalAnchor(b) && (b = "./" + b),
			b = b.replace(/^(\.\/)+/g, "./").replace(/\#$/, ""),
			b
		},
		m.store = {},
		m.idToState = m.idToState || {},
		m.stateToId = m.stateToId || {},
		m.urlToId = m.urlToId || {},
		m.storedStates = m.storedStates || [],
		m.savedStates = m.savedStates || [],
		m.normalizeStore = function() {
			m.store.idToState = m.store.idToState || {},
			m.store.urlToId = m.store.urlToId || {},
			m.store.stateToId = m.store.stateToId || {}
		},
		m.getState = function(a, b) {
			typeof a == "undefined" && (a = !0),
			typeof b == "undefined" && (b = !0);
			var c = m.getLastSavedState();
			return ! c && b && (c = m.createStateObject()),
			a && (c = m.cloneObject(c), c.url = c.cleanUrl || c.url),
			c
		},
		m.getIdByState = function(a) {
			var b = m.extractId(a.url),
			c;
			if (!b) {
				c = m.getStateString(a);
				if (typeof m.stateToId[c] != "undefined") b = m.stateToId[c];
				else if (typeof m.store.stateToId[c] != "undefined") b = m.store.stateToId[c];
				else {
					for (;;) {
						b = (new Date).getTime() + String(Math.random()).replace(/\D/g, "");
						if (typeof m.idToState[b] == "undefined" && typeof m.store.idToState[b] == "undefined") break
					}
					m.stateToId[c] = b,
					m.idToState[b] = a
				}
			}
			return b
		},
		m.normalizeState = function(a) {
			var b, c;
			if (!a || typeof a != "object") a = {};
			if (typeof a.normalized != "undefined") return a;
			if (!a.data || typeof a.data != "object") a.data = {};
			b = {},
			b.normalized = !0,
			b.title = a.title || "",
			b.url = m.getFullUrl(m.unescapeString(a.url || d.location.href)),
			b.hash = m.getShortUrl(b.url),
			b.data = m.cloneObject(a.data),
			b.id = m.getIdByState(b),
			b.cleanUrl = b.url.replace(/\??\&_suid.*/, ""),
			b.url = b.cleanUrl,
			c = !m.isEmptyObject(b.data);
			if (b.title || c) b.hash = m.getShortUrl(b.url).replace(/\??\&_suid.*/, ""),
			/\?/.test(b.hash) || (b.hash += "?"),
			b.hash += "&_suid=" + b.id;
			return b.hashedUrl = m.getFullUrl(b.hash),
			(m.emulated.pushState || m.bugs.safariPoll) && m.hasUrlDuplicate(b) && (b.url = b.hashedUrl),
			b
		},
		m.createStateObject = function(a, b, c) {
			var d = {
				data: a,
				title: b,
				url: c
			};
			return d = m.normalizeState(d),
			d
		},
		m.getStateById = function(a) {
			a = String(a);
			var c = m.idToState[a] || m.store.idToState[a] || b;
			return c
		},
		m.getStateString = function(a) {
			var b, c, d;
			return b = m.normalizeState(a),
			c = {
				data: b.data,
				title: a.title,
				url: a.url
			},
			d = k.stringify(c),
			d
		},
		m.getStateId = function(a) {
			var b, c;
			return b = m.normalizeState(a),
			c = b.id,
			c
		},
		m.getHashByState = function(a) {
			var b, c;
			return b = m.normalizeState(a),
			c = b.hash,
			c
		},
		m.extractId = function(a) {
			var b, c, d;
			return c = /(.*)\&_suid=([0-9]+)$/.exec(a),
			d = c ? c[1] || a: a,
			b = c ? String(c[2] || "") : "",
			b || !1
		},
		m.isTraditionalAnchor = function(a) {
			var b = !/[\/\?\.]/.test(a);
			return b
		},
		m.extractState = function(a, b) {
			var c = null,
			d, e;
			return b = b || !1,
			d = m.extractId(a),
			d && (c = m.getStateById(d)),
			c || (e = m.getFullUrl(a), d = m.getIdByUrl(e) || !1, d && (c = m.getStateById(d)), !c && b && !m.isTraditionalAnchor(a) && (c = m.createStateObject(null, null, e))),
			c
		},
		m.getIdByUrl = function(a) {
			var c = m.urlToId[a] || m.store.urlToId[a] || b;
			return c
		},
		m.getLastSavedState = function() {
			return m.savedStates[m.savedStates.length - 1] || b
		},
		m.getLastStoredState = function() {
			return m.storedStates[m.storedStates.length - 1] || b
		},
		m.hasUrlDuplicate = function(a) {
			var b = !1,
			c;
			return c = m.extractState(a.url),
			b = c && c.id !== a.id,
			b
		},
		m.storeState = function(a) {
			return m.urlToId[a.url] = a.id,
			m.storedStates.push(m.cloneObject(a)),
			a
		},
		m.isLastSavedState = function(a) {
			var b = !1,
			c, d, e;
			return m.savedStates.length && (c = a.id, d = m.getLastSavedState(), e = d.id, b = c === e),
			b
		},
		m.saveState = function(a) {
			return m.isLastSavedState(a) ? !1 : (m.savedStates.push(m.cloneObject(a)), !0)
		},
		m.getStateByIndex = function(a) {
			var b = null;
			return typeof a == "undefined" ? b = m.savedStates[m.savedStates.length - 1] : a < 0 ? b = m.savedStates[m.savedStates.length + a] : b = m.savedStates[a],
			b
		},
		m.getHash = function() {
			var a = m.unescapeHash(d.location.hash);
			return a
		},
		m.unescapeString = function(b) {
			var c = b,
			d;
			for (;;) {
				d = a.unescape(c);
				if (d === c) break;
				c = d
			}
			return c
		},
		m.unescapeHash = function(a) {
			var b = m.normalizeHash(a);
			return b = m.unescapeString(b),
			b
		},
		m.normalizeHash = function(a) {
			var b = a.replace(/[^#]*#/, "").replace(/#.*/, "");
			return b
		},
		m.setHash = function(a, b) {
			var c, e, f;
			return b !== !1 && m.busy() ? (m.pushQueue({
				scope: m,
				callback: m.setHash,
				args: arguments,
				queue: b
			}), !1) : (c = m.escapeHash(a), m.busy(!0), e = m.extractState(a, !0), e && !m.emulated.pushState ? m.pushState(e.data, e.title, e.url, !1) : d.location.hash !== c && (m.bugs.setHash ? (f = m.getPageUrl(), m.pushState(null, null, f + "#" + c, !1)) : d.location.hash = c), m)
		},
		m.escapeHash = function(b) {
			var c = m.normalizeHash(b);
			return c = a.escape(c),
			m.bugs.hashEscape || (c = c.replace(/\%21/g, "!").replace(/\%26/g, "&").replace(/\%3D/g, "=").replace(/\%3F/g, "?")),
			c
		},
		m.getHashByUrl = function(a) {
			var b = String(a).replace(/([^#]*)#?([^#]*)#?(.*)/, "$2");
			return b = m.unescapeHash(b),
			b
		},
		m.setTitle = function(a) {
			var b = a.title,
			c;
			b || (c = m.getStateByIndex(0), c && c.url === a.url && (b = c.title || m.options.initialTitle));
			try {
				d.getElementsByTagName("title")[0].innerHTML = b.replace("<", "&lt;").replace(">", "&gt;").replace(" & ", " &amp; ")
			} catch(e) {}
			return d.title = b,
			m
		},
		m.queues = [],
		m.busy = function(a) {
			typeof a != "undefined" ? m.busy.flag = a: typeof m.busy.flag == "undefined" && (m.busy.flag = !1);
			if (!m.busy.flag) {
				h(m.busy.timeout);
				var b = function() {
					var a, c, d;
					if (m.busy.flag) return;
					for (a = m.queues.length - 1; a >= 0; --a) {
						c = m.queues[a];
						if (c.length === 0) continue;
						d = c.shift(),
						m.fireQueueItem(d),
						m.busy.timeout = g(b, m.options.busyDelay)
					}
				};
				m.busy.timeout = g(b, m.options.busyDelay)
			}
			return m.busy.flag
		},
		m.busy.flag = !1,
		m.fireQueueItem = function(a) {
			return a.callback.apply(a.scope || m, a.args || [])
		},
		m.pushQueue = function(a) {
			return m.queues[a.queue || 0] = m.queues[a.queue || 0] || [],
			m.queues[a.queue || 0].push(a),
			m
		},
		m.queue = function(a, b) {
			return typeof a == "function" && (a = {
				callback: a
			}),
			typeof b != "undefined" && (a.queue = b),
			m.busy() ? m.pushQueue(a) : m.fireQueueItem(a),
			m
		},
		m.clearQueue = function() {
			return m.busy.flag = !1,
			m.queues = [],
			m
		},
		m.stateChanged = !1,
		m.doubleChecker = !1,
		m.doubleCheckComplete = function() {
			return m.stateChanged = !0,
			m.doubleCheckClear(),
			m
		},
		m.doubleCheckClear = function() {
			return m.doubleChecker && (h(m.doubleChecker), m.doubleChecker = !1),
			m
		},
		m.doubleCheck = function(a) {
			return m.stateChanged = !1,
			m.doubleCheckClear(),
			m.bugs.ieDoubleCheck && (m.doubleChecker = g(function() {
				return m.doubleCheckClear(),
				m.stateChanged || a(),
				!0
			},
			m.options.doubleCheckInterval)),
			m
		},
		m.safariStatePoll = function() {
			var b = m.extractState(d.location.href),
			c;
			if (!m.isLastSavedState(b)) return c = b,
			c || (c = m.createStateObject()),
			m.Adapter.trigger(a, "popstate"),
			m;
			return
		},
		m.back = function(a) {
			return a !== !1 && m.busy() ? (m.pushQueue({
				scope: m,
				callback: m.back,
				args: arguments,
				queue: a
			}), !1) : (m.busy(!0), m.doubleCheck(function() {
				m.back(!1)
			}), n.go( - 1), !0)
		},
		m.forward = function(a) {
			return a !== !1 && m.busy() ? (m.pushQueue({
				scope: m,
				callback: m.forward,
				args: arguments,
				queue: a
			}), !1) : (m.busy(!0), m.doubleCheck(function() {
				m.forward(!1)
			}), n.go(1), !0)
		},
		m.go = function(a, b) {
			var c;
			if (a > 0) for (c = 1; c <= a; ++c) m.forward(b);
			else {
				if (! (a < 0)) throw new Error("History.go: History.go requires a positive or negative integer passed.");
				for (c = -1; c >= a; --c) m.back(b)
			}
			return m
		};
		if (m.emulated.pushState) {
			var o = function() {};
			m.pushState = m.pushState || o,
			m.replaceState = m.replaceState || o
		} else m.onPopState = function(b, c) {
			var e = !1,
			f = !1,
			g, h;
			return m.doubleCheckComplete(),
			g = m.getHash(),
			g ? (h = m.extractState(g || d.location.href, !0), h ? m.replaceState(h.data, h.title, h.url, !1) : (m.Adapter.trigger(a, "anchorchange"), m.busy(!1)), m.expectedStateId = !1, !1) : (e = m.Adapter.extractEventData("state", b, c) || !1, e ? f = m.getStateById(e) : m.expectedStateId ? f = m.getStateById(m.expectedStateId) : f = m.extractState(d.location.href), f || (f = m.createStateObject(null, null, d.location.href)), m.expectedStateId = !1, m.isLastSavedState(f) ? (m.busy(!1), !1) : (m.storeState(f), m.saveState(f), m.setTitle(f), m.Adapter.trigger(a, "statechange"), m.busy(!1), !0))
		},
		m.Adapter.bind(a, "popstate", m.onPopState),
		m.pushState = function(b, c, d, e) {
			if (m.getHashByUrl(d) && m.emulated.pushState) throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");
			if (e !== !1 && m.busy()) return m.pushQueue({
				scope: m,
				callback: m.pushState,
				args: arguments,
				queue: e
			}),
			!1;
			m.busy(!0);
			var f = m.createStateObject(b, c, d);
			return m.isLastSavedState(f) ? m.busy(!1) : (m.storeState(f), m.expectedStateId = f.id, n.pushState(f.id, f.title, f.url), m.Adapter.trigger(a, "popstate")),
			!0
		},
		m.replaceState = function(b, c, d, e) {
			if (m.getHashByUrl(d) && m.emulated.pushState) throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");
			if (e !== !1 && m.busy()) return m.pushQueue({
				scope: m,
				callback: m.replaceState,
				args: arguments,
				queue: e
			}),
			!1;
			m.busy(!0);
			var f = m.createStateObject(b, c, d);
			return m.isLastSavedState(f) ? m.busy(!1) : (m.storeState(f), m.expectedStateId = f.id, n.replaceState(f.id, f.title, f.url), m.Adapter.trigger(a, "popstate")),
			!0
		};
		if (f) {
			try {
				m.store = k.parse(f.getItem("History.store")) || {}
			} catch(p) {
				m.store = {}
			}
			m.normalizeStore()
		} else m.store = {},
		m.normalizeStore();
		m.Adapter.bind(a, "beforeunload", m.clearAllIntervals),
		m.Adapter.bind(a, "unload", m.clearAllIntervals),
		m.saveState(m.storeState(m.extractState(d.location.href, !0))),
		f && (m.onUnload = function() {
			var a, b;
			try {
				a = k.parse(f.getItem("History.store")) || {}
			} catch(c) {
				a = {}
			}
			a.idToState = a.idToState || {},
			a.urlToId = a.urlToId || {},
			a.stateToId = a.stateToId || {};
			for (b in m.idToState) {
				if (!m.idToState.hasOwnProperty(b)) continue;
				a.idToState[b] = m.idToState[b]
			}
			for (b in m.urlToId) {
				if (!m.urlToId.hasOwnProperty(b)) continue;
				a.urlToId[b] = m.urlToId[b]
			}
			for (b in m.stateToId) {
				if (!m.stateToId.hasOwnProperty(b)) continue;
				a.stateToId[b] = m.stateToId[b]
			}
			m.store = a,
			m.normalizeStore(),
			f.setItem("History.store", k.stringify(a))
		},
		m.intervalList.push(i(m.onUnload, m.options.storeInterval)), m.Adapter.bind(a, "beforeunload", m.onUnload), m.Adapter.bind(a, "unload", m.onUnload));
		if (!m.emulated.pushState) {
			m.bugs.safariPoll && m.intervalList.push(i(m.safariStatePoll, m.options.safariPollInterval));
			if (e.vendor === "Apple Computer, Inc." || (e.appCodeName || "") === "Mozilla") m.Adapter.bind(a, "hashchange",
			function() {
				m.Adapter.trigger(a, "popstate")
			}),
			m.getHash() && m.Adapter.onDomLoad(function() {
				m.Adapter.trigger(a, "hashchange")
			})
		}
	},
	m.init()
} (window);
var app = app || {}; (function() {
	window.console ||
	function() {
		var a = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
		window.console = {};
		for (var b = 0; b < a.length; ++b) window.console[a[b]] = function() {}
	} ();
	var a = window.navigator.userAgent.toLowerCase();
	Browser.anquan360 = a.indexOf("360se") > -1,
	Browser.jisu360 = a.indexOf("360ee") > -1,
	Browser.qq = a.indexOf("qqbrowser") > -1,
	Browser.sougou = a.indexOf("metasr") > -1,
	Browser.maxthon = a.indexOf("maxthon") > -1,
	"undefined" != typeof document.referrer && !~document.referrer.indexOf(app.host) && Cookie.write("wft", "1"),
	window.addEvent("domready",
	function() {
		window.docScroller = new Fx.Scroll(document.body),
		app.view = app.view || $("page");
		var a = document.id("elevator");
		if (a) { ($("bookmarklet") || app.page.$url == "/message/mentions/" || app.page.$url == "/message/activities/") && a.hide();
			var b = new Fx.Scroll(window, {
				duration: "short"
			});
			new Button(a, {
				click: function() {
					b.toTop()
				}
			}),
			window.addEvent("scroll",
			function(b) {
				window.getScrollTop() > 200 ? a.removeClass("off") : a.addClass("off")
			})
		} ((function() {
			$$(".ts-words").each(function(a) {
				var b = a.retrieve("PinTime");
				if (!b) {
					var c = a.get("data-ts");
					if (!c) return;
					b = new Date(c.toInt() * 1e3),
					a.store("PinTime", b)
				}
				var d = new Date;
				if (d - b > 2592e6) return;
				a.set("html", b.timeAgo())
			})
		})).periodical(6e4)
	})
})(),
String.implement("stripScripts",
function(a) {
	var b = "",
	c = this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,
	function(a, c) {
		return b += ";" + c + "\n",
		""
	});
	return a === !0 ? Browser.exec(b) : typeOf(a) == "function" && a(b, c),
	c
}),
Element.implement({
	mouseOver: function(a) {
		var b = this.getCoordinates();
		return a.x > b.left && a.x < b.right && a.y < b.bottom && a.y > b.top
	},
	setStyles: function(a, b) {
		b && this.store("styles:_old", this.getStyles(Object.keys(a)));
		for (var c in a) this.setStyle(c, a[c]);
		return this
	},
	restoreStyles: function() {
		var a = this.retrieve("styles:_old");
		return a ? (this.erase("styles:_old"), this.setStyles(a)) : this
	},
	absolutize: function() {
		var a = this.getStyle("position");
		if (a === "absolute") return this;
		var b = this.getParent();
		while (b && b.getStyle("position") !== "relative") b = b.getParent();
		b = b || document.body;
		var c = this.getCoordinates(b),
		d = (a === "fixed" ? window: b).getScroll();
		return this.setStyles({
			position: "absolute",
			top: c.top + d.y,
			left: c.left + d.x,
			margin: 0
		},
		!0)
	}
}),
function() {
	Object.append(app, {
		templates: {},
		render: function(a, b, c) {
			var d = this.templates[a];
			if (!d) return "";
			var e = null;
			typeOf(b) === "function" ? (c = b, b = this) : typeOf(b) === "element" && (e = b, b = this);
			var f = d.call(this, b || this);
			return e ? f.stripScripts(function(a, b) {
				e.set("html", b),
				a && Browser.exec(a),
				c && (f = c(a, b))
			}) : c && f.stripScripts(c),
			f
		}
	})
} ();
var Cache = new Class({
	Implements: [Options],
	options: {
		duration: 60,
		capcity: 100
	},
	initialize: function(a) {
		this.setOptions(a),
		this.data = {}
	},
	set: function(a, b, c) {
		return this.data[a] = {
			key: a,
			value: b,
			expires: this.calculateDuration(c || this.options.duration),
			duration: c || this.options.duration,
			lastAccess: Date.now()
		},
		this.isFull() && this.purge.delay(200, this),
		this
	},
	get: function(a) {
		var b = this.data[a];
		if (!b) return null;
		var c = Date.now();
		return b.expires <= c ? (this.clear(a), null) : (b.lastAccess = c, b.value)
	},
	getLength: function() {
		return Object.getLength(this.data)
	},
	isFull: function() {
		return this.getLength() >= this.options.capcity
	},
	load: function(a, b) {
		for (var c in a) a.hasOwnProperty(c) && this.set(c, a[c])
	},
	clear: function(a) {
		return a ? delete this.data[a] : this.data = {},
		this
	},
	calculateDuration: function(a) {
		return a * 1e3 + Date.now()
	},
	purge: function() {
		var a = [],
		b = Date.now();
		Object.each(this.data,
		function(c, d) {
			c.expires <= b ? this.clear(d) : a.push(c)
		}),
		a.sort(function(a, b) {
			return b.lastAccessed - a.lastAccessed
		});
		while (a.length > this.options.capcity) {
			var c = a.pop();
			this.clear(c.key)
		}
	}
}); (function(a) {
	function k() {
		f.getStyle("display") != "none" && !i && (i = (new Element("div#loading_unit")).fade("hide").inject(f), (new Element("h1", {
			html: "\u9875\u9762\u52a0\u8f7d\u4e2d"
		})).inject(i), (new Element(".progress")).inject(i), (new Element("a.go", {
			html: "\u70b9\u6b64\u624b\u52a8\u8df3\u8f6c",
			href: a.location.href
		})).inject(i), i.fade("in"))
	}
	var b = a.History;
	if (!b.enabled) return ! 1;
	b.unescapeString = function(a) {
		return a
	};
	var c = 100,
	d = new Cache({
		duration: 900,
		capcity: Browser.ie ? 4 : 10
	}),
	e = app.scheme + "://" + app.host,
	f,
	g,
	h,
	i,
	j = null,
	l = function(a) {
		if (!g) {
			g = setTimeout(l, a);
			return
		}
		g = null,
		h || (h = new Fx.Tween(f, {
			duration: 1e3
		})),
		f.show(),
		h.chain(function() {
			k.delay(1e3)
		}).set("opacity", 0).start("opacity", 1)
	},
	m = function() {
		g && clearTimeout(g),
		g = null,
		h && h.stop(),
		f.hide(),
		i && (i.destroy(), i = null)
	},
	n = function(b) {
		document.title = "\u52a0\u8f7d\u4e2d...",
		l(100),
		(new Request.JSON({
			url: b,
			noCache: !0,
			onSuccess: function(a) {
				var c = Object.append({
					$url: b
				},
				a);
				o(c)
			},
			onFailure: function() {
				a.location.href = b
			}
		})).get()
	},
	o = function(b) {
		j = null,
		m(),
		app.view.dispose(),
		app.page.$waterfall && app.page.$waterfall.detach(),
		app.page.$view || app.view.destroy(),
		app.messager && app.messager.registerStateHandler(),
		app.page = b;
		if (b.$view) app.view = b.$view,
		app.view.inject(document.body, "top"),
		b.$scroll && a.scrollTo(b.$scroll.x, b.$scroll.y),
		b.$waterfall && b.$waterfall.attach();
		else {
			app.view = (new Element("div", {
				id: "view"
			})).inject(document.body, "top");
			var c = b.err ? "/_error": b.$url;
			app.route(c),
			app.setTitle()
		}
	},
	p = function(e) {
		if (app.page.$url === e || b.savedStates.length > c) {
			a.location.href = e;
			return
		}
		var f = d.get(e);
		f ? o(f) : n(e),
		a._gaq && _gaq.push(["_trackPageview", e])
	};
	b.Adapter.bind(a, "statechange",
	function() {
		var a = b.getState();
		if (j && j[a.id]) return j[a.id](a);
		var c = "/" + a.url.replace(e, "").replace(/^\//, "");
		return j && j[c] ? j[c](a) : p(c)
	}),
	Object.append(app, {
		onRoute: function() {
			app.page.$waterfall && (app.page.$view = app.view, d.set(app.page.$url, app.page)),
			app.setTitle(),
			a.scrollTo(0, 0)
		},
		setTitle: function() {
			return app.page.title = app.page.title || History.options.initialTitle,
			b.setTitle(app.page),
			this
		},
		registerStateHandler: function(a, b) {
			return j = j || {},
			j[a] = b,
			this
		},
		removeStateHandler: function(a) {
			return j && delete j[a],
			this
		},
		getState: function(a) {
			return "undefined" == typeof a ? b.getState() : b.getStateByIndex(a)
		},
		replaceState: function(a, c, d) {
			return d = "/" + d.replace(e, "").replace(/^\//, ""),
			b.replaceState(a, c, d),
			this
		},
		pushState: function(a, c, d) {
			return d = "/" + d.replace(e, "").replace(/^\//, ""),
			b.pushState(a, c, d),
			this
		},
		popState: function() {
			return this.back()
		},
		go: function(a) {
			return this.pushState(null, null, a)
		},
		back: function() {
			return b.back(),
			b.Adapter.trigger(a, "popstate"),
			this
		},
		forward: function() {
			return b.forward(),
			b.Adapter.trigger(a, "popstate"),
			this
		}
	}),
	a.addEvent("domready",
	function() {
		app.onRoute(),
		f = document.id("page_overlay");
		var b = Cookie.read("_is_qplus");
		$(document.body).addEvent("click:relay(a.x)",
		function(c) {
			if (!app._csr || c.meta || c.control || c.shift || c.alt || c.event.button !== 0) return ! 0;
			var d = c.target;
			d.get("tag") !== "a" && (d = d.getParent("a"));
			var e = d.get("href");
			e && e.test(/^\/message\//) && (app._prepath = location.pathname);
			if (e) if (Browser.ie && !b) {
				if (e.test(/^\/pins\/\d+\/?/g) && !d.hasClass("self")) {
					c.stop();
					var f = a.open(e, "_blank");
					try {
						f.focus()
					} catch(c) {}
					return ! 1
				}
			} else if (e.indexOf("/") === 0 && app.getRouter(e)) return c.stop(),
			app.go(e),
			!1;
			return ! 0
		}),
		new Gestures({
			onBack: function() {
				app.back()
			},
			onForward: function() {
				app.forward()
			}
		})
	}),
	a.addEvent("scroll",
	function() {
		if (!app.page) return;
		app.page.$scroll = a.getScroll()
	})
})(window),
Object.append(app, {
	showDialog: function(a) {
		if (Browser.ie6 && 0) { (new SmoothNotification({
				style: "window",
				styles: {
					width: "500px",
					height: "220px",
					border: "3px dashed #999",
					background: "#FFD"
				},
				duration: !1,
				closeButton: !0
			})).show(new Element("div", {
				html: '<h3>\u60a8\u6b63\u5728\u4f7f\u7528\u7684 IE6 \u6d4f\u89c8\u5668\u65e0\u6cd5\u5b8c\u6210\u91c7\u96c6\u4efb\u52a1</h3><a href="http://www.google.com/chrome/eula.html?hl=zh-CN&amp;standalone=1" target="_blank" style="display: block; margin-top: 10px; margin-right: auto; margin-bottom: 10px; margin-left: auto; "><img src="/img/ie6_chrome.png" style="height: 140px; width: 380px; " data-pinit="registered"></a><a href="http://v.youku.com/v_show/id_XMjc4MzYxMTY0.html" target="_blank" style="margin-right: 10px; ">\u89c2\u770b IE6 \u6d4f\u89c8\u5668\u5341\u5e74\u89c6\u9891</a><a href="http://theie6countdown.cn/" target="_blank">\u4e86\u89e3 IE6 \u6d4f\u89c8\u5668\u7684\u5371\u5bb3(\u6765\u81ea\u5fae\u8f6f\u4e2d\u56fd)</a></div><div style="background-image: url(http://pinban.com/img/pointy_tip_close_btn.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; cursor: pointer; width: 18px; height: 18px; position: absolute; right: 15px; top: 15px; background-position: 0px 0px; background-repeat: no-repeat no-repeat; ">',
				styles: {
					"text-align": "center"
				}
			}));
			return
		}
		this.hideDialog();
		var b = "_dialog_" + a;
		this[b] || this.render(b,
		function(a, c) {
			var d = (new Element("div")).set("html", c),
			e = this[b] = d.getFirst().inject(this.view);
			e.store("dialog_id", b),
			a && Browser.exec(a)
		}.bind(this)),
		document.body.setStyle("overflow", "hidden");
		var c = document.id("_huaban_FixFlashStyle");
		if (!c) {
			var d = new Element("style", {
				id: "_huaban_FixFlashStyle"
			}),
			e = "object, embed {visibility: hidden}"; (document.getElement("head") || document.body).grab(d),
			Browser.ie ? d.styleSheet.cssText = e: d.set("text", e)
		}
		this[b].show(),
		this._currentDialog = this[b];
		var f = this[b].retrieve("onShow");
		"function" == typeof f && f.apply(this, Array.prototype.slice.call(arguments, 1))
	},
	hideDialog: function() {
		var a = document.id("_huaban_FixFlashStyle");
		a && a.destroy();
		var b = this._currentDialog;
		b && (b.hide(), document.body.setStyle("overflow", "auto"), b.hasClass("destroy") && (delete this[b.retrieve("dialog_id")], b.destroy()), delete this._currentDialog)
	},
	forceLogin: function() {
		return app.req.user ? !0 : (window.location.href = "/login/?next=" + app.page.$url, !1)
	},
	initFollowButtons: function() {
		if (app.view.retrieve("followbutton")) return;
		app.view.addEvent("click:relay(a.follow,a.unfollow)",
		function(a) {
			app.forceLogin();
			var b = a.target;
			b.get("tag") !== "a" && (b = b.getParent("a"));
			var c = b.get("data-id"),
			d = (new Button(b)).disable();
			return b.hasClass("unfollow") ? (d.setTitle("Unfollowing..."), (new Request.JSON({
				url: "/boards/" + c + "/unfollow/",
				onSuccess: function(a) {
					if (a.err) return d.setTitle("\u53d6\u6d88\u5173\u6ce8"),
					alert(a.msg);
					b.removeClass("unfollow").addClass("follow"),
					d.setTitle("\u5173\u6ce8").enable()
				}
			})).post()) : (d.setTitle("\u5173\u6ce8\u4e2d..."), (new Request.JSON({
				url: "/boards/" + c + "/follow/",
				onSuccess: function(a) {
					if (a.err) return d.setTitle("\u5173\u6ce8"),
					alert(a.msg);
					b.addClass("unfollow").removeClass("follow"),
					d.setTitle("\u53d6\u6d88\u5173\u6ce8").enable()
				}
			})).post()),
			!1
		}),
		app.view.store("followbutton", !0)
	},
	initFollowUserButtons: function(a) {
		if (app.view.retrieve("followuserbutton")) return;
		app.view.addEvent("click:relay(a.followuser,a.unfollowuser)",
		function(b) {
			app.forceLogin();
			var c = b.target;
			c.get("tag") !== "a" && (c = c.getParent("a"));
			var d = c.get("data-id"),
			e = (new Button(c)).disable();
			return c.hasClass("unfollowuser") ? (e.setTitle("Unfollowing..."), (new Request.JSON({
				url: "/" + d + "/unfollow/",
				onSuccess: function(b) {
					if (b.err) return e.setTitle("\u53d6\u6d88\u5173\u6ce8"),
					alert(b.msg);
					c.removeClass("unfollowuser").removeClass("wbtn").addClass("followuser").addClass("rbtn"),
					e.setTitle("\u5173\u6ce8").enable(),
					a && a(c)
				}
			})).post()) : (e.setTitle("\u5173\u6ce8\u4e2d..."), (new Request.JSON({
				url: "/" + d + "/follow/",
				onSuccess: function(b) {
					if (b.err) return e.setTitle("\u5173\u6ce8"),
					alert(b.msg);
					c.addClass("unfollowuser").removeClass("followuser").removeClass("rbtn").addClass("wbtn"),
					e.setTitle("\u53d6\u6d88\u5173\u6ce8").enable(),
					a && a(c)
				}
			})).post()),
			!1
		}),
		app.view.store("followuserbutton", !0)
	},
	initLikeButtons: function() {
		if (app.view.retrieve("likebutton")) return;
		app.view.addEvent("click:relay(a.like,a.unlike)",
		function(a) {
			app.forceLogin();
			var b = a.target;
			b.get("tag") !== "a" && (b = b.getParent("a"));
			var c = b.get("data-id"),
			d = (new Button(b)).disable();
			return b.hasClass("unlike") ? (d.setTitle("Unliking..."), (new Request.JSON({
				url: "/pins/" + c + "/unlike/",
				onSuccess: function(a) {
					b.removeClass("unlike"),
					d.setTitle("\u559c\u6b22").enable()
				}
			})).post()) : (d.setTitle("Liking..."), (new Request.JSON({
				url: "/pins/" + c + "/like/",
				onSuccess: function(a) {
					b.addClass("unlike"),
					d.setTitle("\u53d6\u6d88\u559c\u6b22").enable()
				}
			})).post()),
			!1
		}),
		app.view.store("likebutton", !0)
	},
	initDelCommentButtons: function() {
		if (app.view.retrieve("delcommentbutton")) return;
		app.view.addEvent("click:relay(a.DeleteComment)",
		function(a) {
			app.forceLogin();
			var b = a.target;
			b.get("tag") !== "a" && (b = b.getParent("a"));
			var c = b.get("data-url");
			return (new Request.JSON({
				url: c,
				data: {
					_method: "DELETE"
				},
				onSuccess: function(a) {
					if (a.err) return alert(a.msg);
					var c = b.getParent("div.comment");
					c && c.tween("opacity", 0).get("tween").chain(function() {
						c.destroy()
					})
				}
			})).post(),
			!1
		}),
		app.view.store("delcommentbutton", !0)
	},
	initReplyButtons: function() {
		if (app.view.retrieve("replybutton")) return;
		app.view.addEvent("click:relay(a.pinViewReplyButton)",
		function(a) {
			app.forceLogin();
			var b = a.target;
			b.get("tag") !== "a" && (b = b.getParent("a"));
			var c = b.get("data-name"),
			d = $("CloseupComment");~d.value.indexOf(c) || (d.value = "@" + c + " " + d.value),
			d.setCaretPosition("end").fireEvent("keyup")
		}),
		app.view.store("replybutton", !0)
	},
	initAddCommentButtons: function() {
		function a(a) {
			if (a.hasClass("ani-affected")) return;
			a.addEvents({
				keydown: function(a) {
					a.key == "esc" && a.target.blur();
					if (a.key == "enter" && (!Browser.Platform.mac && a.control || Browser.Platform.mac && a.meta)) return c.bind(this.getNext(".grid_comment_button"))(),
					!1
				},
				focus: function() {
					this.getParent("form").getPrevious("a.img").addClass("comment-avatar-show"),
					this.addClass("comment-with-avatar")
				},
				blur: function() {
					this.value || (this.getParent("form").getPrevious("a.img").removeClass("comment-avatar-show"), this.removeClass("comment-with-avatar"))
				}
			}).addClass("ani-affected")
		}
		function b(a) {
			if (a.get("registered-at")) return;
			a.set("registered-at", "registered"),
			new Autocompleter.Contacts.At(a, {
				width: 154,
				delay: 300
			})
		}
		function c() {
			var a = this;
			if (a.hasClass("disabled")) return ! 1;
			var b = a.getParent("div.pin"),
			c = b.getElement("div.write"),
			d = c.getElement("form"),
			e = d.getElement("textarea"),
			f = c.getPrevious("div.comments"),
			g = e.get("value").trim();
			return g == "" || g == "\u6dfb\u52a0\u8bc4\u8bba..." ? (e.highlight(), !1) : (a.addClass("disabled"), (new Request.JSON({
				url: d.get("action"),
				data: {
					text: g
				},
				onSuccess: function(c) {
					if (c.err) alert(c.msg);
					else {
						a.getParent(".write").hide().getParent(".pin").getElement(".actions .comment").removeClass("disabled"),
						e.set("value", "");
						var d = app.render("_comment_item_convo", c.comment),
						g = Elements.from(d).inject(f);
						f.isDisplayed() || f.show(),
						g.highlight("#EEE");
						var h = app.page.$waterfall;
						h && h.update(b)
					}
					a.removeClass("disabled")
				},
				onFailure: function() {
					alert("\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5"),
					a.removeClass("disabled")
				}
			})).post(), !1)
		}
		if (app.view.retrieve("addcommentbutton")) return;
		app.view.addEvent("click:relay(textarea.GridComment)",
		function(c) {
			var d = c.target;
			a(d),
			d.fireEvent("focus"),
			b(d)
		}),
		app.view.addEvent("click:relay(a.comment,a.replyButton)",
		function(c) {
			if (!app.forceLogin()) return;
			var d = c.target;
			d.get("tag") !== "a" && (d = d.getParent("a"));
			var e = d.getParent("div.pin"),
			f = e.getElement("div.write"),
			g = f.getElement("textarea"),
			h = app.page.$waterfall;
			new FancyInput(g),
			a(g),
			b(g);
			if (d.hasClass("disabled")) f.hide(),
			h && h.update(e),
			d.removeClass("disabled");
			else {
				f.show(),
				h && h.update(e),
				docScroller.chain(function() {
					try {
						g.focus()
					} catch(a) {}
					g.highlight()
				}),
				e.getSize().y > document.html.clientHeight ? docScroller.toElementCenter(g, "y") : docScroller.toElement(e, "y");
				if (d.hasClass("replyButton")) {
					var i = d.getSiblings("p")[0].getElement(".author").innerHTML;
					g.value == "\u6dfb\u52a0\u8bc4\u8bba..." && (g.value = ""),
					~g.value.indexOf(i) || (g.value = "@" + i + " " + g.value, g.setCaretPosition("end").fireEvent("keyup")),
					e.getElements(".actions .comment")[0].addClass("disabled")
				} else d.addClass("disabled")
			}
			return ! 1
		}),
		app.view.addEvent("click:relay(.grid_comment_button)", c),
		app.view.store("addcommentbutton", !0)
	},
	promotion: function() {
		_gaq = window._gaq || [];
		var a = Cookie.read("md") || "",
		b = Cookie.read("utm_source") || "",
		c = Cookie.read("utm_medium") || "",
		d = Cookie.read("utm_campaign") || "";
		if (!a) return;
		var e = {
			md: a,
			utm_source: b,
			utm_medium: c,
			utm_campaign: d
		},
		f = [];
		for (k in e) e[k] && f.push(k + "=" + e[k]);
		f.join("&"),
		f = f ? "?" + f: "",
		_gaq.push(["_trackPageview", "/ref/" + a + "/" + f])
	}
});
var Button = new Class({
	Implements: [Options, Class.Occlude],
	options: {},
	property: "Button",
	initialize: function(a, b) {
		this.element = document.id(a);
		if (this.occlude()) return this.occluded;
		this.setOptions(b),
		this.label = this.element.getElement("strong"),
		this.title = this.label.get("html"),
		this.action = this.options.click ? this.options.click.bind(this) : !1,
		delete this.options.click,
		this.attach(),
		this.element.hasClass("disabled") && this.disable()
	},
	setTitle: function(a) {
		return a = a || this.title,
		~this.title.indexOf("<em>") && !~a.indexOf("<em>") && (a = "<em></em>" + a),
		this.label.set("html", a),
		this
	},
	show: function() {
		this.element.show()
	},
	hide: function() {
		this.element.hide()
	},
	attach: function() {
		return this.action && this.element.addEvent("click", this.action),
		this._disabled = !1,
		this
	},
	detach: function() {
		return this.action && this.element.removeEvent("click", this.action),
		this._disabled = !0,
		this
	},
	disable: function() {
		return this._disabled ? this: (this.detach(), this.element.addClass("disabled"), this.options.disabledTitle && this.setTitle(this.options.disabledTitle), this)
	},
	enable: function() {
		return this._disabled === !1 ? this: (this.attach(), this.element.removeClass("disabled"), this.options.disabledTitle && this.setTitle(this.title), this)
	},
	bind: function(a) {
		var b = instanceOf(a, FancyInput) ? a: a.retrieve("FancyInput");
		return b && b.addEvents({
			feed: this.enable.bind(this),
			hunger: this.disable.bind(this)
		}),
		this
	}
}),
PointyTip = new Class({
	Implements: [Events, Options, Class.Occlude],
	options: {},
	property: "PointyTip",
	initialize: function(a, b) {
		this.element = document.id(a);
		if (this.occlude()) return this.occluded;
		this.setOptions(b),
		this.titleEl = this.element.getElement(".title"),
		this.title = this.titleEl ? this.titleEl.get("html") : !1,
		this.contentEl = this.element.getElement(".content"),
		this.content = this.contentEl ? this.contentEl.get("html") : !1,
		this.closeBtn = this.element.getElement(".close"),
		this.arrow = this.element.getElement(".arrow"),
		this.arrowMask = this.element.getElement(".arrow-mask"),
		this.attach()
	},
	reset: function(a) {
		a.position && this.element.setStyles(a.position);
		if (a.arrow) {
			delete a.arrow.top,
			delete a.arrow.bottom;
			var b = Object.merge({
				left: "auto"
			},
			a.arrow);
			this.arrow.setStyles(b),
			b.right ? b.right -= 10 : b.left -= 10,
			this.arrowMask.setStyles(b)
		}
		this.element.show()
	},
	setTitle: function(a) {
		return this.title = a,
		this
	},
	attach: function() {
		this.closeBtn && (this.addEvent("close",
		function() {
			this.element.hide()
		}.bind(this)), this.closeBtn.addEvents({
			click: function() {
				this.fireEvent("close")
			}.bind(this)
		}))
	},
	close: function() {
		this.fireEvent("close")
	}
}); (function() {
	if (Modernizr.input.placeholder) return;
	this.Form || (this.Form = {}),
	this.Form.Placeholder = new Class({
		Implements: Options,
		options: {
			color: "#A9A9A9",
			clearOnSubmit: !0
		},
		initialize: function(a, b) {
			this.setOptions(b),
			this.element = document.id(a),
			this.placeholder = this.element.get("placeholder"),
			this.original_color = this.element.getStyle("color"),
			this.is_password = this.element.get("type") == "password" ? !0 : !1,
			this.activatePlaceholder(),
			this.element.addEvents({
				focus: function() {
					this.deactivatePlaceholder()
				}.bind(this),
				blur: function() {
					this.activatePlaceholder()
				}.bind(this)
			}),
			this.element.getParent("form") && this.options.clearOnSubmit && this.element.getParent("form").addEvent("submit",
			function(a) {
				this.element.get("value") == this.placeholder && this.element.set("value", "")
			}.bind(this))
		},
		activatePlaceholder: function() {
			if (this.element.get("value") == "" || this.element.get("value") == this.placeholder) this.is_password && this.element.set("type", "text"),
			this.element.setStyle("color", this.options.color),
			this.element.set("value", this.placeholder)
		},
		deactivatePlaceholder: function() {
			this.element.get("value") == this.placeholder && (this.is_password && this.element.set("type", "password"), this.element.set("value", ""), this.element.setStyle("color", this.original_color))
		}
	})
})();
var FancyInput = new Class({
	Binds: ["_checker"],
	Implements: [Events, Options, Class.Occlude],
	options: {},
	property: "FancyInput",
	initialize: function(a, b) {
		this.element = document.id(a);
		if (this.occlude()) return this.occluded;
		this.setOptions(b),
		this.label = this.element.getNext("label"),
		this.placeholder = this.element.get("placeholder"),
		!this.label && this.placeholder && !Modernizr.input.placeholder && new Form.Placeholder(this.element);
		if (Browser.ie && this.label) {
			if (Browser.ie6) {
				var a = this.label.getNext("span.fff");
				a && a.dispose()
			}
			this.label.addEvent("click",
			function() {
				this.element.focus()
			}.bind(this))
		}
		this.attach()
	},
	attach: function() {
		this._timer = null,
		this.element.addEvents({
			keyup: this._checker,
			focus: function() {
				this._timer = this._checker.periodical(500),
				this.fireEvent("focus", this)
			}.bind(this),
			blur: function() {
				this._timer && clearTimeout(this._timer),
				this.fireEvent("blur", this)
			}.bind(this)
		}),
		this._checker()
	},
	setValue: function(a) {
		this.element.set("value", a),
		this._checker()
	},
	getValue: function() {
		return this.element.get("value")
	},
	_checker: function() {
		this.element.get("value") != "" ? (this.label && this.label.hide(), this.fireEvent("feed")) : (this.label && this.label.show(), this.fireEvent("hunger"))
	}
}),
PopupPicker = new Class({
	Implements: [Events, Options],
	Binds: ["attach", "show", "bodyClicked"],
	options: {},
	initialize: function(a, b, c) {
		this.setOptions(c),
		this.element = document.id(a),
		this.popup = document.id(b),
		this.attach(),
		this.popup.addEvent("click:relay(li)",
		function(a) {
			var b = a.target;
			b.get("tag") != "li" && (b = b.getParent()),
			this.fireEvent("pick", b),
			this.hide()
		}.bind(this))
	},
	attach: function() {
		this.element.addEvent("click", this.show)
	},
	detach: function() {
		this.element.removeEvent("click", this.show)
	},
	show: function() {
		this.detach(),
		this.popup.show(),
		document.body.addEvent("click", this.bodyClicked),
		this.fireEvent("show")
	},
	hide: function() {
		this.popup.hide(),
		document.body.removeEvent("click", this.bodyClicked),
		this.attach.delay(100),
		this.fireEvent("hide")
	},
	bodyClicked: function(a) {
		this.popup.isDisplayed() && !this.popup.mouseOver(a.page) && this.hide()
	}
}),
CategoryPicker = new Class({
	Implements: [Class.Occlude, Events, Options],
	Binds: ["select"],
	property: "CategoryPicker",
	options: {
		itemHeight: 30,
		maxVisibleItems: 8,
		setHeight: !1
	},
	initialize: function(a, b) {
		this.element = document.id(a);
		if (this.occlude()) return this.occluded;
		this.setOptions(b),
		this.init()
	},
	init: function() {
		var a = this.element;
		this._maxH = this.options.itemHeight * this.options.maxVisibleItems,
		this.curEl = a.getElement(".CurrentBoard"),
		this.popEl = a.getElement(".BoardList"),
		this.bodyEl = a.getElement(".BoardListBody"),
		this.listEl = this.bodyEl.getElement("ul"),
		this.popup = new PopupPicker(a, this.popEl, {
			onPick: this.select.bind(this)
		}),
		this.build()
	},
	build: function() {
		this._empty(),
		app.settings.categories.each(function(a) {
			this._injectItem(a.id, a.name)
		},
		this)
	},
	_empty: function() {
		this._items = 0,
		this.listEl.empty()
	},
	_injectItem: function(a, b) {
		this._items += 1;
		var c = (new Element("li", {
			"class": "BoardCategory",
			data: a,
			html: "<span>" + b + "</span>"
		})).inject(this.listEl);
		if (this.options.setHeight) {
			var d = this._items * this.options.itemHeight;
			this.bodyEl.setStyle("height", d > this._maxH ? this._maxH: d)
		}
		return c
	},
	select: function(a) {
		if (!a) return;
		if (typeOf(a) === "element") return this.curEl.store("data", a.get("data")).set("html", a.getElement("span").get("html")),
		this.fireEvent("select"),
		this;
		var b = this.listEl.getElements("li");
		for (var c = 0,
		d = b.length; c < d; c++) if (b[c].get("data") == a) return this.select(b[c]);
		return this
	},
	hide: function() {
		this.popup.hide()
	},
	getSelected: function() {
		return this.curEl.retrieve("data")
	}
}),
BoardPicker = new Class({
	Extends: CategoryPicker,
	options: {
		setHeight: !0
	},
	init: function() {
		this.parent(),
		app.req.user.boards ? this.build() : (new Request.JSON({
			url: "/boards/",
			noCache: !0,
			onSuccess: function(a) {
				a.err ? this.curEl.set("html", a.msg) : (app.req.user.boards = a.boards, this.build())
			}.bind(this),
			onFailure: function() {
				this.curEl.set("html", "\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5")
			}.bind(this)
		})).get()
	},
	add: function(a) {
		app.req.user.boards.push(a);
		var b = this._injectItem(a.board_id, a.title);
		return this.select(b),
		this
	},
	build: function() {
		if (!app.req.user.boards) return;
		var a = app.req.user.boards;
		if (!a || a.length === 0) return;
		this._empty(),
		a.each(function(a) {
			this._injectItem(a.board_id, a.title)
		},
		this),
		this.select(this.listEl.getFirst("li"))
	}
}),
ImagePicker = new Class({
	Implements: [Events, Options, Class.Occlude],
	options: {
		cellW: 170,
		minW: 100,
		minH: 100
	},
	property: "ImagePicker",
	initialize: function(a, b) {
		this.element = document.id(a);
		if (this.occlude()) return this.occluded;
		this.setOptions(b),
		this.listEl = this.element.getElement(".carousel-list"),
		this.arrowEl = this.element.getElement(".Arrows"),
		this.loadEl = this.element.getElement(".load"),
		this.attach()
	},
	attach: function() {
		var a = !0;
		this.listEl.get("tween").addEvents({
			start: function() {
				a = !1
			},
			complete: function() {
				a = !0
			}
		}),
		this.arrowEl.getElements("a.picker").addEvent("click",
		function(b) {
			var c = this.listEl.getStyle("left").toInt(),
			d = this.listEl.getStyle("width").toInt();
			return b.target.hasClass("imagePickerNext") && c > this.options.cellW - d ? a && this.listEl.tween("left", c, c - this.options.cellW) : b.target.hasClass("imagePickerPrevious") && c < 0 && a && this.listEl.tween("left", c, c + this.options.cellW),
			!1
		}.bind(this))
	},
	load: function(a, b, c, d) {
		if (this.loading) return;
		typeOf(c) == "function" && (d = c, c = !0),
		c = c === undefined ? !0 : !!c;
		if (a.length == 0) return;
		this.loading = !0,
		this.loadEl.show(),
		this.fireEvent("startLoading");
		var e = new Asset.images(a, {
			onComplete: function() {
				this.loadEl.hide(),
				this.loading = !1,
				c && (e = e.filter(function(a) {
					return a.width === "" || a.height === "" || a.width.toInt() >= this.options.minW && a.height.toInt() >= this.options.minH
				}.bind(this))),
				typeOf(d) == "function" && d(e),
				this.build(e, b),
				this.fireEvent("finishLoading")
			}.bind(this)
		});
		return e
	},
	build: function(a, b) {
		this.source = b,
		this.listEl.set("tween", {
			duration: "short"
		}).setStyles({
			width: a.length * this.options.cellW,
			left: 0
		}).empty(),
		a.each(function(a) {
			a.width >= a.height ? a.set("width", this.options.cellW).erase("height") : a.set("height", this.options.cellW).erase("width"),
			a.inject((new Element("li", {
				"class": "carousel-item"
			})).inject(this.listEl))
		},
		this),
		a.length > 1 ? this.arrowEl.show() : this.arrowEl.hide()
	},
	insertImageElement: function(a, b, c) {
		c.width >= c.height ? c.set("width", this.options.cellW).erase("height") : c.set("height", this.options.cellW).erase("width"),
		c.inject((new Element("li", {
			"class": "carousel-item"
		})).inject(this.listEl))
	},
	assetComplate: function() {
		this.loadEl.hide(),
		this.loading = !1,
		this.fireEvent("finishLoading")
	},
	getSelected: function() {
		var a = 0 - this.listEl.getStyle("left").toInt() / this.options.cellW,
		b = this.listEl.getElements("li img")[a];
		return {
			el: b,
			src: b.src,
			link: this.source
		}
	}
});
app.createCellLoader = function(a, b, c, d) {
	function h(a, b) {
		var c;
		return a.pin_id ? c = app.render("_pin_item", {
			user: a.user || b.user,
			pin: a,
			board: a.board || b.board
		}) : a.board_id ? c = app.render("_board_item", {
			board: a,
			user: app.req.user
		}) : c = app.render("_user_item", {
			user: a,
			current_user: app.req.user
		}),
		(new Element("div")).set("html", c).getFirst()
	}
	function i(a) {
		var b;
		return a.pin_id ? b = a.seq ? a.seq: a.pin_id: a.board_id ? b = a.seq: b = a.user_id,
		b
	}
	var e = !1,
	f = !1,
	g = [];
	return b = b || 10,
	typeof c == "function" ? (d = c, c = null) : c = c || 1,
	function(j, k) {
		k = k ? k: "load";
		switch (k) {
		case "load":
			if (e) return;
			e = !0;
			var l = j.getLast();
			if (!l) return;
			var m = l.get("data-seq");
			j.showIndicator();
			var n = c ? {
				page: ++c,
				per_page: b
			}: {
				max: m,
				limit: b
			}; (new Request.JSON({
				url: a,
				noCache: !0,
				data: n,
				onSuccess: function(a) {
					j.hideIndicator();
					if (a.err) {
						alert(a.msg);
						return
					}
					var a = d ? d(a) : {
						data: a.pins
					};
					a.data.length && a.data.each(function(b) {
						j.append(h(b, a.extra))
					}),
					a.data.length < b && j.stopLoader(!0)
				},
				onComplete: function() {
					e = !1
				}
			})).get();
			break;
		case "fetch":
			if (f) return;
			f = !0;
			if (g.length >= 100) return;
			var o;
			g.length > 0 ? o = i(g.getLast()) : o = j.getFirst().get("data-seq");
			if (!o) return; (new Request.JSON({
				url: a,
				data: {
					since: o,
					limit: 100
				},
				noCache: !0,
				onSuccess: function(a) {
					if (a.err) {
						alert(a.msg);
						return
					}
					var a = d ? d(a) : {
						data: a.pins
					};
					if (a.data && a.data.length > 0) {
						g = g.concat(a.data);
						var b = g.length,
						c = b >= 100 ? "100+": b;
						j.setNewIndicatorTitle(c + "\u6761\u65b0\u91c7\u96c6"),
						document.title.match(/^\(\d+\)/) ? document.title = document.title.replace(/^\(\d+\)/, "(" + c + ")") : document.title = "(" + c + ") " + document.title,
						j.showNewIndicator()
					}
				},
				onComplete: function() {
					f = !1,
					j.scheduleFetcher()
				}
			})).get();
			break;
		case "show_new":
			document.title = document.title.replace(/^\(\d+\+?\) /, ""),
			j.hideNewIndicator();
			var p = [];
			if (g.length) {
				for (var q = g.length - 1; q >= 0; q--) p.push(h(g[q]));
				g = [],
				j.insert(p)
			}
			break;
		default:
			alert("CellLoader unkown action")
		}
	}
};
var Waterfall = new Class({
	Binds: ["resize", "scroll", "_append", "fetchNew"],
	Implements: [Options, Events],
	options: {
		container: null,
		cellWidth: 222,
		cellSpace: 15,
		cellSelector: "div.wfc",
		sideSpace: 0,
		preservedCols: 0,
		containerSelector: "div.wrapper",
		loadOffset: 100,
		loader: null,
		fetcher: !1
	},
	initialize: function(a, b) {
		this.element = document.id(a),
		this.setOptions(b),
		this.container = this.options.container ? document.id(this.options.container) : document.body,
		this.cols = 0,
		this.width = 0,
		this.height = 0,
		this.options.cellSelector ? this.cells = this.element.getElements(this.options.cellSelector) : this.cells = new Elements,
		this._top = this.element.getCoordinates(this.container).top,
		this.options.loader && (this._indicator = this._createIndicator()),
		this.options.fetcher && (this._newIndicator = this._createNewIndicator()),
		this._appending = [],
		Cookie.read("wft") && (Cookie.dispose("wft"), this.cells.addClass("wft")),
		this.attach()
	},
	_createIndicator: function() {
		return (new Element("div", {
			"class": "loading"
		})).inject(this.element, "after").hide().set("html", '<img src="/img/loading.gif"><span>\u6b63\u5728\u52a0\u8f7d...</span>')
	},
	_createNewIndicator: function() {
		var a = (new Element("a", {
			id: "NewIndicator",
			"class": "btn wbtn Indicator"
		})).inject(app.view, "top").hide().set("html", "<strong>\u6709\u65b0\u7684\u91c7\u96c6</strong><span></span>"),
		b = this;
		return new Button(a, {
			click: function() {
				b.options.loader(b, "show_new")
			}
		})
	},
	setNewIndicatorTitle: function(a) {
		this._newIndicator && (this._newIndicator.title = a, this._newIndicator.setTitle(a))
	},
	showIndicator: function() {
		this._indicator && this._indicator.show()
	},
	showNewIndicator: function() {
		this._newIndicator && this._newIndicator.show()
	},
	hideIndicator: function() {
		this._indicator && this._indicator.hide()
	},
	hideNewIndicator: function() {
		this._newIndicator && this._newIndicator.hide()
	},
	fetchNew: function() {
		this.options.loader(this, "fetch")
	},
	scheduleFetcher: function() {
		this._newIndicator && (this._fetchTimer && clearTimeout(this._fetchTimer), this._fetchTimer = setTimeout(this.fetchNew, 3e4))
	},
	attach: function() {
		window.addEvent("resize", this.resize),
		window.addEvent("scroll", this.scroll),
		this.scheduleFetcher()
	},
	detach: function() {
		window.removeEvent("resize", this.resize),
		window.removeEvent("scroll", this.scroll),
		this._fetchTimer && (clearTimeout(this._fetchTimer), delete this._fetchTimer)
	},
	resize: function() {
		return this.reposition()
	},
	scroll: function() {
		if (!this.options.loader || this._stopLoading || this._appending.length) return;
		var a = window.getSize().y,
		b = window.getScroll().y,
		c = this._hs[this._minCol] + this._top;
		if (b + a < c - this.options.loadOffset) return;
		this.options.loader(this)
	},
	stopLoader: function(a) {
		return this._stopLoading = !0,
		a && this._indicator && this._indicator.set("html", '<img src="/img/end.png">').show(),
		this
	},
	startLoader: function() {
		return this._stopLoading = !1,
		this._indicator && (this._indicator.destroy(), this._indicator = this._createIndicator()),
		this
	},
	getLast: function() {
		return this.cells.getLast()
	},
	getFirst: function() {
		return this.cells[0].get("data-seq") ? this.cells[0] : this.cells[1]
	},
	_getFirstIndex: function() {
		return this.cells[0].get("data-seq") ? 0 : 1
	},
	reposition: function(a) {
		if (this._needsLayout(a)) {
			this._updateWidth();
			for (var b = 0,
			c = this.cells.length; b < c; b++) this._position(this.cells[b]);
			this.fireEvent("layout", this)
		}
		return this
	},
	update: function(a) {
		var b = a.retrieve("wf:col"),
		c = a.getHeight(),
		d = c - a.retrieve("wf:height"),
		e = this.cells,
		f = e.indexOf(a),
		g = [];
		for (var h = f + 1,
		i = e.length; h < i; h++) {
			var j = e[h];
			j.retrieve("wf:col") === b && j.setStyle("top", j.getStyle("top").toInt() + d)
		}
		return this._hs[b] += d,
		a.store("wf:height", c),
		this
	},
	insert: function(a) {
		Array.from(a).each(function(a) {
			this._insert(a)
		},
		this),
		this.cells.length > 100 && this.strip(this.cells.length - 100),
		docScroller.toTop(),
		this.reposition(!0)
	},
	strip: function(a) {
		while (a--) {
			var b = this.cells.pop();
			if (!b) break;
			b.destroy()
		}
		return this._stopLoading && this.startLoader(),
		this
	},
	_insert: function(a) {
		return a.inject(this.getFirst(), "before"),
		this.cells.contains(a) || this.cells.splice(this._getFirstIndex(), 0, a),
		this
	},
	append: function(a) {
		return this.element.adopt(a),
		Modernizr.csstransitions ? a.setStyle("opacity", 0) : a.setStyle("display", "none"),
		this.cells.include(a),
		this._appending.push(a),
		this._appendTimer || (this._appendTimer = setTimeout(this._append, 10)),
		this
	},
	isShowNewIndicator: function() {
		return this._newIndicator && this._newIndicator.element.isVisible()
	},
	_append: function() {
		delete this._appendTimer;
		var a = this.cols - this.options.preservedCols;
		while (a--) {
			var b = this._appending.shift();
			if (!b) return this.scroll();
			this._position(b)
		}
		this._appendTimer = setTimeout(this._append, 100)
	},
	_updateWidth: function() {
		$$(this.options.containerSelector).setStyle("width", this.width)
	},
	_position: function(a) {
		var b = this.cols - this.options.preservedCols,
		c = 0,
		d = this._hs;
		if (a.hasClass("topright")) c = b - 1;
		else for (var e = 0; e < b; e++) d[e] < d[c] && (c = e);
		a.setStyles({
			position: "absolute",
			display: "",
			left: c * (this.options.cellWidth + this.options.cellSpace),
			top: d[c]
		}),
		Modernizr.csstransitions && a.setStyle("opacity", 1);
		var f = a.getHeight();
		a.store("wf:height", f).store("wf:col", c),
		d[c] += f + this.options.cellSpace;
		var g = min = 0;
		for (var e = 0; e < b; e++) d[e] < d[min] && (min = e),
		d[e] > d[g] && (g = e);
		this._maxCol = g,
		this._minCol = min,
		this.element.setStyle("height", d[g] + 50)
	},
	_needsLayout: function(a) {
		var b = this.options.cellWidth + this.options.cellSpace,
		c = Math.floor((this.container.getWidth() - this.options.sideSpace * 2) / b);
		if (!a && this.cols === c) return ! 1;
		var d = [];
		for (var e = 0; e < c; e++) d.push(0);
		return this.width = c * b - this.options.cellSpace,
		this.cols = c,
		this._hs = d,
		!0
	}
}),
Uploadr = new Class({
	Implements: [Options, Events, Class.Occlude],
	options: {
		url: "/upload/",
		uploadText: "\u6b63\u5728\u4e0a\u4f20...",
		fieldName: "file"
	},
	property: "Uploadr",
	initialize: function(a, b) {
		this.target = this.element = document.id(a);
		if (this.occlude()) return this.occluded;
		this.setOptions(b),
		Browser.ie ? (this.box = (new Element("div")).inject(this.target, "after"), this.target.hide()) : (this.box = (new Element("div")).setStyles({
			position: "absolute",
			opacity: .01,
			overflow: "hidden"
		}).inject(this.target, "after"), this.btn = new Button(this.target, {
			disabledTitle: this.options.uploadText,
			click: function() {
				return this.file.click(),
				!1
			}.bind(this)
		})),
		this.create()
	},
	create: function() {
		this.clear(),
		this.iframe || (this.iframe = (new IFrame({
			src: "javascript:'<html></html>'",
			frameborder: "no",
			border: 0
		})).inject(this.box), this.iframe.addEvents({
			load: this.onLoad.bind(this)
		})),
		Browser.ie ? (this.iframe.setStyles({
			width: 300,
			height: 30
		}), this.runner = this.createIBody.periodical(50, this)) : (this.iframe.setStyle("display", "none"), this.createInput())
	},
	createIBody: function() {
		var a = this.iframe.contentWindow.document;
		if (!a || !a.body) return;
		clearTimeout(this.runner),
		a.body.innerHTML = '<form method="post" enctype="multipart/form-data" id="form"><input type="file" id="file" style="position:absolute;left:0;top:0;" /><div id="data"></div></form><style type="text/css">body{background:#FCF9F9;}input{border: 1px solid #999;padding: 5px;}</style>',
		this.doc = a,
		this.processIBody.delay(50, this)
	},
	processIBody: function() {
		if (! (this.file = this.doc.getElementById("file")) || !this.file.offsetHeight) return this.createIBody();
		this.file.onchange = this.select.bind(this)
	},
	createInput: function() {
		var a = this.file = (new Element("input", {
			type: "file",
			name: this.options.fieldName,
			size: 1,
			styles: {
				position: "absolute",
				top: 0,
				left: 0,
				border: 0
			}
		})).inject(this.box);
		a.onfocus = function() {
			return ! 1
		},
		a.onchange = this.select.bind(this)
	},
	onLoad: function() {
		if (!this.iframe.parentNode) return;
		var a = this.iframe.contentWindow.document,
		b = a.body.innerHTML;
		if (this.loaded === !1) this.loaded = !0;
		else if (b !== "") {
			this.loaded = !0;
			var c = b.match(/(\{.+\})/g);
			b = JSON.decode(c[0], !0),
			b.err ? this.fireEvent("failed", [b]) : this.fireEvent("complete", [b]),
			this.enable(),
			this.create()
		}
	},
	disable: function() {
		this.btn && this.btn.disable(),
		this.disabled = !0
	},
	enable: function() {
		this.btn && this.btn.enable(),
		this.disabled = !1
	},
	select: function() {
		this.disabled || this.disable(),
		this.file.onchange = this.file.onmousedown = this.file.onfocus = null;
		if (Browser.ie) {
			var a = this.iframe.contentWindow.document;
			this.form = a.forms[0],
			this.file = this.form.elements[0]
		} else this.form = (new Element("form", {
			method: "post",
			enctype: "multipart/form-data",
			target: this.iframe.get("name"),
			styles: {
				width: 0,
				height: 0,
				overflow: "hidden"
			}
		})).adopt(this.file).inject(this.box);
		this.form.action = this.options.url,
		this.file.name = this.options.fieldName,
		this.fireEvent("start"),
		this.form.submit(),
		Browser.ie && this.iframe.set("visibility", "hidden")
	},
	reposition: function() {
		var a = this.target.getCoordinates(this.box.getOffsetParent());
		this.box.setStyles(a)
	},
	clear: function() {
		Browser.ie || this.form && this.form.destroy(),
		this.form = null,
		this.file = null
	}
}),
StaticScroller = new Class({
	Implements: [Options, Events],
	options: {
		offset: 20,
		scrollElement: document
	},
	initialize: function(a, b) {
		this.setOptions(b),
		this.element = document.id(a),
		this.scrollElement = document.id(this.options.scrollElement),
		this.originalPosition = this.element.getPosition(),
		this.bound = {
			scroll: this.scroll.bind(this),
			resize: this.resize.bind(this)
		},
		this.attachWindow(),
		this.checkHeight()
	},
	attachScroll: function() {
		return this.scrollElement.addEvent("scroll", this.bound.scroll),
		this
	},
	attachWindow: function() {
		return window.addEvent("resize", this.bound.resize),
		this
	},
	detachScroll: function() {
		return this.scrollElement.removeEvent("scroll", this.bound.scroll),
		this
	},
	detachWindow: function() {
		return window.removeEvent("resize", this.bound.resize),
		this
	},
	checkHeight: function() {
		return document.getSize().y < this.element.getSize().y ? this.detachScroll().reset() : this.attachScroll().scroll(),
		this
	},
	isPinned: function() {
		return this.element.retrieve("pin:_pinned")
	},
	scroll: function() {
		var a = this.scrollElement.getScroll().y >= this.originalPosition.y - this.options.offset,
		b = this.isPinned();
		return a ? b || (this.element.pin().setStyle("top", this.options.offset.toInt()), this.fireEvent("pin")) : b && this.reset(),
		this
	},
	resize: function() {
		return this.isPinned() && this.reset(),
		this.checkHeight(),
		this
	},
	reset: function() {
		this.isPinned() && (this.element.unpin().setStyles({
			position: "",
			top: this.originalPosition.y
		}), this.fireEvent("unpin"))
	}
}),
SmoothNotification = new Class({
	Implements: [Options],
	options: {
		duration: 3e3,
		styles: {
			position: "absolute",
			"z-index": 999999,
			"text-align": "center"
		},
		dispose: !0,
		style: "normal",
		relative: {
			to: "",
			position: "topcenter",
			edge: "bottomcenter",
			offset: {
				x: 0,
				y: 0
			}
		},
		fadeType: "down",
		horizontalCenter: !0,
		verticalCenter: !1,
		closeButton: !1,
		arrow: !1,
		arrowColor: "rgba(0, 0, 0, 0.6)",
		mask: !1,
		maskStyle: {}
	},
	initialize: function(a) {
		this.setOptions(a),
		this.main = new Element("div.smooth-notification"),
		this.mask = new Element("div.sm-mask"),
		this.closeButton = (new Element("div.sm-closeButton")).addEvent("click",
		function() {
			this.hide()
		}.bind(this))
	},
	setPosition: function() {
		$$("body")[0].grab(this.main, "top"),
		this.main.setStyles({
			top: 0,
			left: 0
		}),
		this.options.relative.to ? this.main.position({
			relativeTo: this.options.relative.to,
			position: this.options.relative.position,
			edge: this.options.relative.edge,
			offset: this.options.relative.offset
		}) : (this.options.horizontalCenter && this.main.setStyle("left", document.documentElement.clientWidth / 2 + window.getScroll().x - this.main.getSize().x / 2), this.options.verticalCenter && (this.main.getStyle("position") != "fixed" ? this.main.setStyle("top", document.documentElement.clientHeight / 2 + window.getScroll().y - this.main.getSize().y / 2) : this.main.setStyle("top", document.body.getSize().y / 2 - this.main.getSize().y / 2)))
	},
	setCloseButton: function() {
		this.options.closeButton ? this.closeButton.inject(this.main) : this.closeButton.dispose
	},
	setArrow: function() {
		if (!this.options.arrow) return;
		var a = !0;
		this.options.arrowColor != "rgba(0, 0, 0, 0.6)" && (a = !1),
		Browser.ie6 && (this.options.arrowColor = this.options.arrowColor.rgbToHex(), this.main.setStyle("filter", 0));
		var b = new Element("div#sm_arrow");
		a ? b.set("class", "pic-" + this.options.arrow) : (b.set("class", "border-arrow border-" + this.options.arrow), this.options.arrow == "down" && b.setStyle("border-top-color", this.options.arrowColor), this.options.arrow == "up" && b.setStyle("border-bottom-color", this.options.arrowColor), this.options.arrow == "left" && b.setStyle("border-right-color", this.options.arrowColor), this.options.arrow == "right" && b.setStyle("border-left-color", this.options.arrowColor)),
		b.inject(this.main),
		this.main.setStyles({
			"border-radius": "5px",
			"box-shadow": "none"
		})
	},
	setMask: function() {
		if (!this.options.mask) return;
		var a = document.html.getScrollSize(); (Browser.ie6 || Browser.ie7) && this.mask.setStyles({
			width: document.body.offsetWidth,
			height: document.body.offsetHeight,
			position: "absolute"
		}),
		this.mask.inject(document.body)
	},
	setDefaultOption: function(a) {
		a == "window" && (this.options.horizontalCenter = this.options.verticalCenter = !0)
	},
	show: function(a, b) {
		this.setOptions(b),
		this.main.dispose(),
		clearTimeout(this.hideTimer),
		clearTimeout(this.disposeTimer),
		a && (this.main.empty(), typeOf(a) == "string" ? this.main.grab(new Element("a.notification", {
			html: a
		})) : this.main.grab(a)),
		this.setDefaultOption(this.options.style),
		this.setCloseButton(),
		this.main.set("class", ["smooth-notification", this.options.fadeType, this.options.style].join(" ")),
		this.main.setStyles(this.options.styles),
		this.setPosition(),
		this.setArrow(),
		this.setMask(),
		this.main.setStyles(this.options.styles),
		function() {
			this.main.addClass("show")
		}.delay(150, this),
		this.options.duration && (this.hideTimer = function() {
			this.hide()
		}.delay(this.options.duration + 150, this))
	},
	hide: function() {
		this.main.removeClass("show"),
		this.mask.dispose(),
		this.disposeTimer = function() {
			this.options.dispose && this.main.dispose(),
			this.options.complete && this.options.complete()
		}.delay(150, this)
	}
}),
Gestures = new Class({
	Extends: Drag,
	options: {
		snap: 10,
		minX: 150,
		maxY: 100,
		style: !1,
		modifiers: {},
		preventDefault: !0,
		stopPropagation: !0
	},
	initialize: function(a) {
		this.parent(document.body, a),
		this.bound.eventStop = Function.from(!0),
		this.bound.contextMenu = this._contextmenu.bind(this),
		this.addEvents({
			drag: this._drag.bind(this),
			complete: this._complete.bind(this)
		}),
		this._skipmenu = 0,
		this.document.addEvent("contextmenu", this.bound.contextMenu),
		Modernizr.canvas && (this.canvas = new Element("canvas", {
			styles: {
				position: "fixed",
				top: 0,
				left: 0,
				zIndex: 10001
			}
		}))
	},
	start: function(a) {
		return ! a.rightClick || Browser.Platform.linux ? !0 : Browser.Platform.mac && !a.control && !a.meta ? !0 : (this.canvas && this.canvas.setProperties({
			width: window.innerWidth,
			height: window.innerHeight
		}), a.rightClick = !1, this._skipmenu = 1, this.parent(a))
	},
	cancel: function(a) {
		return this.canvas && this.canvas.dispose(),
		a && (this._skipmenu = 0),
		this.parent(a)
	},
	stop: function(a) {
		return a && a.rightClick && a.preventDefault(),
		this.parent(a)
	},
	_contextmenu: function(a) {
		return ! this._skipmenu
	},
	_complete: function(a, b) {
		this.canvas && this.canvas.dispose();
		var c = this.mouse.now.x - this.mouse.start.x,
		d = this.mouse.now.y - this.mouse.start.y;
		if (Math.abs(c) < this.options.minX || Math.abs(d) > this.options.maxY) return;
		c > 0 ? this.fireEvent("forward") : this.fireEvent("back")
	},
	_drag: function(a, b) {
		if (!this.canvas) return;
		var c = window.getScroll(),
		d = this.canvas.getContext("2d");
		d.strokeStyle = "rgba(233,59,72,0.83)",
		d.lineWidth = 5,
		d.lineCap = "round",
		d.lineJoin = "round",
		d.shadowColor = "rgba(0,0,0,0.45)",
		d.shadowOffsetX = 2,
		d.shadowOffsetY = 2,
		d.shadowBlur = 3,
		d.clearRect(0, 0, this.canvas.width, this.canvas.height),
		d.beginPath(),
		d.moveTo(this.mouse.start.x - c.x, this.mouse.start.y - c.y),
		d.lineTo(this.mouse.now.x - c.x, this.mouse.now.y - c.y),
		d.stroke(),
		this.canvas.parentNode || document.body.appendChild(this.canvas)
	}
}),
SlidePage = new Class({
	Extends: Fx,
	options: {
		direction: "right",
		fixedSelector: null
	},
	initialize: function(a, b) {
		this.element = document.id(a),
		this.container = document.id(document.body),
		this.view = app.view,
		this.elevator = document.id("elevator"),
		this.parent(b),
		this.left = this.options.direction === "left"
	},
	prepareShow: function() {
		var a = Object.append(this.container.getSize(), {
			scroll: this.container.getScroll()
		});
		a.from = 0,
		this.left ? a.to = -a.x: a.to = a.x;
		if (this.options.fixedSelector) {
			var b = document.getElements(this.options.fixedSelector);
			b.absolutize()
		}
		return this.container.setStyles({
			overflow: "hidden"
		},
		!0),
		this.view.setStyles({
			position: "absolute",
			top: 0,
			width: a.x
		},
		!0),
		this.element.setStyles({
			position: "absolute",
			top: a.scroll.y,
			left: this.left ? 0 - a.x: a.x,
			width: a.x,
			height: a.y
		},
		!0),
		this.elevator && this.elevator.hide(),
		a
	},
	prepareHide: function() {
		var a = this.state;
		return this.container.setStyles({
			overflow: "hidden"
		}),
		this.view.setStyles({
			top: -a.scroll.y
		}),
		this.elevator && this.elevator.hide(),
		this
	},
	set: function(a) {
		return this.view.setStyle("left", -a),
		this.element.setStyle("left", this.left ? -(this.state.x + a) : this.state.x - a),
		this
	},
	show: function() {
		var a = this.state = this.prepareShow();
		return this.start(a.from, a.to).chain(function() {
			this.element.setStyles({
				top: 0
			}),
			this.container.scrollTo(0, 0),
			this.callChain()
		}.bind(this))
	},
	hide: function() {
		var a = this.state;
		return this.prepareHide().start(a.to, a.from).chain(function() {
			this.elevator && this.elevator.show(),
			this.element.restoreStyles(),
			this.view.restoreStyles().setStyles({
				width: "auto",
				top: 0
			}),
			this.container.restoreStyles().scrollTo(a.scroll.x, a.scroll.y);
			if (this.options.fixedSelector) {
				var b = document.getElements(this.options.fixedSelector);
				b.restoreStyles()
			}
			delete this.state,
			this.callChain()
		}.bind(this))
	}
}),
MessageChecker = new Class({
	Binds: ["fetchNew"],
	Implements: [Options, Events],
	options: {
		fetcher: !0
	},
	initialize: function(a) {
		this._unread_mentions = this._unread_feeds = 0,
		this.setOptions(a),
		this.options.fetcher && (this._indicator = this._createIndicator()),
		this.attach()
	},
	_createIndicator: function() {
		this._arrow = (new Element("a", {
			id: "arrow-btn",
			"class": "in"
		})).grab((new Element("span", {
			"class": "arrow"
		})).grab(new Element("span")));
		var a = (new Element("div", {
			id: "MessageIndicator",
			"class": "message-indicator"
		})).grab(this._arrow).inject(document.body, "top").hide();
		this._activities = new Element("li", {
			html: '<a href="/message/activities/">\u65b0\u6d88\u606f</a>'
		}),
		this._mentions = new Element("li", {
			html: '<a href="/message/mentions/">@\u6211\u7684</a>'
		});
		var b = (new Element("ul", {
			"class": "nav"
		})).grab(this._activities).grab(this._mentions).inject(a, "top"),
		c = this,
		d,
		e = !1;
		return this._arrow.addEvents({
			click: function() {
				d && clearTimeout(d);
				if (e) return;
				e = !0,
				function() {
					e = !1
				}.delay(700),
				this.hasClass("in") ? c.slideOutIndicator() : this.hasClass("out") && c.slideInIndicator()
			},
			mouseover: function() {
				this.hasClass("in") && (d = setTimeout(function() {
					c._arrow.fireEvent("click")
				},
				500))
			},
			mouseout: function() {
				d && clearTimeout(d)
			}
		}),
		this.initShowMessage(),
		a
	},
	initShowMessage: function() {
		this.registerStateHandler(),
		this._activities.getElement("a").addEvent("click",
		function() {
			return app._prepath = location.pathname,
			this.showActivities(),
			!1
		}.bind(this)),
		this._mentions.getElement("a").addEvent("click",
		function() {
			return app._prepath = location.pathname,
			this.showMentions(),
			!1
		}.bind(this))
	},
	registerStateHandler: function() {
		var a = this,
		b, c, d = app.getState().id,
		e = "/message/",
		f = function() {
			c = b.retrieve("slide"),
			c || (c = new SlidePage(b, {
				direction: "left",
				fixedSelector: "#pin_toolbar, #NewIndicator, #MessageIndicator"
			}), b.store("slide", c)),
			b.inject(document.body).show(),
			a.hideIndicator(),
			c.show().chain(function() {
				b.setStyles({
					width: "100%",
					height: "auto"
				})
			}),
			app.registerStateHandler(d, g),
			app.page.$waterfall && app.page.$waterfall.detach(),
			a.detach()
		},
		g = function() {
			app.page.$waterfall && app.page.$waterfall.attach(),
			a.attach();
			if (!b) return;
			c = b.retrieve("slide"),
			c.hide().chain(function() {
				a.showIndicator(!0),
				b.destroy(),
				b = null
			}),
			app.removeStateHandler(d)
		},
		h = function(a) {
			b ? f() : (new Request.JSON({
				url: a,
				noCache: !0,
				onSuccess: function(a) {
					if (a.err) return alert(a.msg);
					app.messages = a.messages,
					app.render("_message", {
						messages: a.messages
					},
					function(a, c) {
						b = Elements.from(c)[0],
						b.getElement("#msgl_hide").addEvent("click",
						function() {
							return app.popState(),
							!1
						}),
						f(),
						a && Browser.exec(a)
					})
				}
			})).get()
		};
		app.registerStateHandler(e + "activities/",
		function() {
			h("/message/activities/")
		}),
		app.registerStateHandler(e + "mentions/",
		function() {
			h("/message/mentions/")
		})
	},
	showActivities: function() {
		if (Browser.ie && Browser.version < 9) {
			location.href = "/message/activities/";
			return
		}
		this.hideIndicator(),
		this.setNewActivitiesNum(0),
		app.pushState(null, null, "/message/activities/")
	},
	showMentions: function() {
		if (Browser.ie && Browser.version < 9) {
			location.href = "/message/mentions/";
			return
		}
		this.hideIndicator(),
		this.setNewMentionsNum(0),
		app.pushState(null, null, "/message/mentions/")
	},
	setNewActivitiesNum: function(a) {
		this._unread_feeds = a;
		var b = a > 1e3 ? "1000+": a;
		this._activities.getElement("a").set("html", b + "\u6761\u65b0\u6d88\u606f")
	},
	setNewMentionsNum: function(a) {
		this._unread_mentions = a;
		var b = a > 1e3 ? "1000+": a;
		this._mentions.getElement("a").set("html", b + "\u6761@\u6211\u7684")
	},
	slideInIndicator: function() {
		this._indicator && (function() {
			this._arrow.removeClass("out").addClass("in")
		}.bind(this).delay(500), this._indicator.setStyle("left", "-123px"))
	},
	slideOutIndicator: function() {
		this._indicator && (function() {
			this._arrow.removeClass("in").addClass("out")
		}.bind(this).delay(500), this._indicator.setStyle("left", "-3px"))
	},
	showIndicator: function(a) {
		if (!app.page.hideIndicator && this._indicator && !~location.pathname.indexOf("/message/")) {
			if (!this._unread_mentions && !this._unread_feeds) {
				if (a || this._isShowed) this._mentions.getElement("a").set("html", "\u67e5\u770b\u65b0\u6d88\u606f"),
				this._mentions.show(),
				this._activities.hide(),
				this.slideInIndicator(),
				this._indicator.show();
				return
			}
			this._unread_mentions ? this._mentions.show() : this._mentions.hide(),
			this._unread_feeds ? this._activities.show() : this._activities.hide(),
			this._arrow.removeClass("in").addClass("out"),
			this._indicator.show(),
			this._indicator.setStyle("left", "-3px"),
			this._isShowed = !0
		}
	},
	hideIndicator: function() {
		this._indicator && this._indicator.hide()
	},
	fetchNew: function() {
		this.loader(this, "fetch")
	},
	scheduleFetcher: function(a) {
		var b = a ? 0 : 3e4;
		this._indicator && (this._fetchTimer && clearTimeout(this._fetchTimer), this._fetchTimer = setTimeout(this.fetchNew, b))
	},
	attach: function() {
		this.scheduleFetcher(!0)
	},
	detach: function() {
		this._fetchTimer && (clearTimeout(this._fetchTimer), delete this._fetchTimer)
	},
	loader: function() {
		var a = !1,
		b = "/message/unread/";
		return function() {
			if (a) return;
			a = !0,
			(new Request.JSON({
				url: b,
				noCache: !0,
				onSuccess: function(a) {
					var b = a.unread_mentions > this._unread_mentions || a.unread_feeds > this._unread_feeds;
					a.unread_mentions && this.setNewMentionsNum(a.unread_mentions),
					a.unread_feeds && this.setNewActivitiesNum(a.unread_feeds),
					b && this.showIndicator()
				}.bind(this),
				onComplete: function() {
					a = !1,
					this.scheduleFetcher()
				}.bind(this)
			})).get()
		}
	} ()
}); (function() {
	Array.isArray || (Array.isArray = function(a) {
		return "[object Array]" == Object.prototype.toString.call(a)
	}),
	Object.keys || (Object.keys = function(a) {
		var b = [];
		for (var c in a) a.hasOwnProperty(c) && b.push(c);
		return b
	}),
	Object.append || (Object.append = function(a) {
		for (var b = 1,
		c = arguments.length; b < c; b++) {
			var d = arguments[b] || {};
			for (var e in d) a[e] = d[e]
		}
		return a
	}),
	String.prototype.len || (String.prototype.len = function() {
		var a = this.toString(),
		b = 0;
		for (var c = 0; c < a.length; c++) {
			var d = a.charCodeAt(c);
			d > 128 ? b += 2 : b += 1
		}
		return b
	}),
	String.prototype.brief || (String.prototype.brief = function(a, b) {
		b = b || "...";
		var c = 0,
		d = "";
		for (var e = 0,
		f = this.length; e < f; e++) {
			var g = this.charCodeAt(e);
			g > 128 ? c += 2 : c += 1;
			if (! (c <= a)) return d + b;
			d += this.charAt(e)
		}
		return d
	}),
	String.prototype.nl2br || (String.prototype.nl2br = function() {
		return this.replace(/(\r|\n)+/g, "<br/>")
	}),
	String.prototype.format_text || (String.prototype.format_text = function(a) {
		if (!a) return this.nl2br();
		var b = Array.isArray(a.mentions) && a.mentions || [],
		c = Array.isArray(a.links) && a.links || [],
		d = Array.isArray(a.tags) && a.tags || [];
		a = b.concat(c, d).sort(function(a, b) {
			return a.start - b.start
		});
		if (!a || a.length <= 0) return this.nl2br();
		var e = [],
		f = this,
		g = 0;
		for (var h = 0; h < a.length; h++) a[h].mention_id && (e.push(f.substr(g, a[h].start - g)), e.push('<a href="/' + a[h].user.urlname + '/">@'), e.push(f.substr(a[h].start + 1, a[h].offset - 1)), e.push("</a>")),
		g = a[h].start + a[h].offset;
		return e.push(f.substr(g)),
		e.join("").nl2br()
	})
})(),
function() {
	var a, b = /\\?([a-z])/gi,
	c = ["Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
	d = function(a, b) {
		return f[a] ? f[a]() : b
	},
	e = function(a, b) {
		return (a += "").length < b ? (new Array(++b - a.length)).join("0") + a: a
	},
	f = {
		d: function() {
			return e(f.j(), 2)
		},
		D: function() {
			return f.l().slice(0, 3)
		},
		j: function() {
			return a.getDate()
		},
		l: function() {
			return c[f.w()] + "day"
		},
		N: function() {
			return f.w() || 7
		},
		S: function() {
			var a = f.j();
			return a < 4 | a > 20 && ["st", "nd", "rd"][a % 10 - 1] || "th"
		},
		w: function() {
			return a.getDay()
		},
		z: function() {
			var a = new Date(f.Y(), f.n() - 1, f.j()),
			b = new Date(f.Y(), 0, 1);
			return Math.round((a - b) / 864e5) + 1
		},
		W: function() {
			var a = new Date(f.Y(), f.n() - 1, f.j() - f.N() + 3),
			b = new Date(a.getFullYear(), 0, 4);
			return e(1 + Math.round((a - b) / 864e5 / 7), 2)
		},
		F: function() {
			return c[6 + f.n()]
		},
		m: function() {
			return e(f.n(), 2)
		},
		M: function() {
			return f.F().slice(0, 3)
		},
		n: function() {
			return a.getMonth() + 1
		},
		t: function() {
			return (new Date(f.Y(), f.n(), 0)).getDate()
		},
		L: function() {
			var a = f.Y();
			return a % 4 == 0 & a % 100 != 0 | a % 400 == 0
		},
		o: function() {
			var a = f.n(),
			b = f.W(),
			c = f.Y();
			return c + (a === 12 && b < 9 ? -1 : a === 1 && b > 9)
		},
		Y: function() {
			return a.getFullYear()
		},
		y: function() {
			return (f.Y() + "").slice( - 2)
		},
		a: function() {
			return a.getHours() > 11 ? "pm": "am"
		},
		A: function() {
			return f.a().toUpperCase()
		},
		B: function() {
			var b = a.getUTCHours() * 3600,
			c = a.getUTCMinutes() * 60,
			d = a.getUTCSeconds();
			return e(Math.floor((b + c + d + 3600) / 86.4) % 1e3, 3)
		},
		g: function() {
			return f.G() % 12 || 12
		},
		G: function() {
			return a.getHours()
		},
		h: function() {
			return e(f.g(), 2)
		},
		H: function() {
			return e(f.G(), 2)
		},
		i: function() {
			return e(a.getMinutes(), 2)
		},
		s: function() {
			return e(a.getSeconds(), 2)
		},
		u: function() {
			return e(a.getMilliseconds() * 1e3, 6)
		},
		e: function() {
			throw "Not supported (see source code of date() for timezone on how to add support)"
		},
		I: function() {
			var a = new Date(f.Y(), 0),
			b = Date.UTC(f.Y(), 0),
			c = new Date(f.Y(), 6),
			d = Date.UTC(f.Y(), 6);
			return 0 + (a - b !== c - d)
		},
		O: function() {
			var b = a.getTimezoneOffset(),
			c = Math.abs(b);
			return (b > 0 ? "-": "+") + e(Math.floor(c / 60) * 100 + c % 60, 4)
		},
		P: function() {
			var a = f.O();
			return a.substr(0, 3) + ":" + a.substr(3, 2)
		},
		T: function() {
			return "UTC"
		},
		Z: function() {
			return - a.getTimezoneOffset() * 60
		},
		c: function() {
			return "Y-m-d\\Th:i:sP".replace(b, d)
		},
		r: function() {
			return "D, d M Y H:i:s O".replace(b, d)
		},
		U: function() {
			return a / 1e3 | 0
		}
	};
	Date.format = function(c, e) {
		return typeof c == "number" && (e = c, c = "Y-m-d H:i:s"),
		a = e == null ? new Date: e instanceof Date ? new Date(e) : new Date(e * 1e3),
		c.replace(b, d)
	},
	Date.prototype.format = function(a) {
		return Date.format(a, this)
	}
} (),
function() {
	var a = {
		lessThanMinuteAgo: "\u521a\u521a",
		minuteAgo: "1\u5206\u949f\u524d",
		minutesAgo: "{delta}\u5206\u949f\u524d",
		hourAgo: "1\u5c0f\u65f6\u524d",
		hoursAgo: "{delta}\u5c0f\u65f6\u524d",
		dayAgo: "\u6628\u5929",
		daysAgo: "{delta}\u5929\u524d",
		weekAgo: "1\u5468\u524d",
		weeksAgo: "{delta}\u5468\u524d",
		monthAgo: "1\u4e2a\u6708\u524d",
		monthsAgo: "{delta}\u4e2a\u6708\u524d",
		yearAgo: "1\u5e74\u524d",
		yearsAgo: "{delta}\u5e74\u524d",
		lessThanMinuteUntil: "\u4ece\u73b0\u5728\u5f00\u59cb\u4e0d\u52301\u5206\u949f",
		minuteUntil: "\u4ece\u73b0\u5728\u5f00\u59cb\u7d041\u5206\u949f",
		minutesUntil: "\u4ece\u73b0\u5728\u5f00\u59cb\u7ea6{delta}\u5206\u949f",
		hourUntil: "\u4ece\u73b0\u5728\u5f00\u59cb1\u5c0f\u65f6",
		hoursUntil: "\u4ece\u73b0\u5728\u5f00\u59cb\u7ea6{delta}\u5c0f\u65f6",
		dayUntil: "\u4ece\u73b0\u5728\u5f00\u59cb1\u5929",
		daysUntil: "\u4ece\u73b0\u5728\u5f00\u59cb{delta}\u5929",
		weekUntil: "\u4ece\u73b0\u5728\u5f00\u59cb1\u661f\u671f",
		weeksUntil: "\u4ece\u73b0\u5728\u5f00\u59cb{delta}\u661f\u671f",
		monthUntil: "\u4ece\u73b0\u5728\u5f00\u59cb\u4e00\u4e2a\u6708",
		monthsUntil: "\u4ece\u73b0\u5728\u5f00\u59cb{delta}\u4e2a\u6708",
		yearUntil: "\u4ece\u73b0\u5728\u5f00\u59cb1\u5e74",
		yearsUntil: "\u4ece\u73b0\u5728\u5f00\u59cb{delta}\u5e74"
	};
	Date.getTimePhrase = function(a) {
		var b = a < 0 ? "Until": "Ago";
		a < 0 && (a *= -1);
		var c = {
			minute: 60,
			hour: 60,
			day: 24,
			week: 7,
			month: 52 / 12,
			year: 12,
			eon: Infinity
		},
		d = "lessThanMinute";
		for (var e in c) {
			var f = c[e];
			if (a < 1.5 * f) {
				a > .75 * f && (d = e);
				break
			}
			a /= f,
			d = e + "s"
		}
		return a = Math.round(a),
		{
			msg: d,
			delta: a,
			suffix: b
		}
	},
	Date.timeAgo = function(b) {
		var c = b == null ? new Date: b instanceof Date ? new Date(b) : new Date(b * 1e3),
		d = Math.round((new Date - c) / 1e3);
		if (d > 2592e3) return Date.format("Y-m-d H:i:s", c);
		var e = Date.getTimePhrase(d);
		return a[e.msg + e.suffix].replace("{delta}", e.delta)
	},
	Date.prototype.timeAgo = function() {
		return Date.timeAgo(this)
	}
} (),
function(a) {
	return Object.append(a, {
		templates: {},
		attrs: function(b) {
			var c = [],
			d = b.terse;
			delete b.terse;
			var e = Object.keys(b),
			f = e.length;
			if (f) {
				c.push("");
				for (var g = 0; g < f; ++g) {
					var h = e[g],
					i = b[h];
					"boolean" == typeof i || null == i ? i && (d ? c.push(h) : c.push(h + '="' + h + '"')) : "class" == h && Array.isArray(i) ? c.push(h + '="' + a.escape(i.join(" ")) + '"') : c.push(h + '="' + a.escape(i) + '"')
				}
			}
			return c.join(" ")
		},
		_: function(a) {
			return a ? String(a).replace(/&(?!\w+;)/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;") : a
		},
		img: function(a, b, c) {
			var d = '<img src="' + this.imgURL(a, b) + '"',
			e = this.imgSize(a, b);
			d += ' width="' + e.w + '" height="' + e.h + '"';
			if (c) for (k in c) d += " " + k + '="' + c[k] + '"';
			return d + "/>"
		},
		imgURL: function(a, b) {
			return "http://" + this.settings.imgHosts[a.bucket] + "/" + a.key + (b ? "_" + b: "")
		},
		imgSize: function(a, b) {
			if (!b) return {
				w: a.width,
				h: a.height
			};
			var c, d, e = a.width,
			f = a.height,
			g = b.substr(0, 2),
			h = Number(b.substr(2));
			switch (g) {
			case "sq":
				c = d = h;
				break;
			case "fm":
				if (h < 0 || e < h && f < h) c = e,
				d = f;
				else {
					c = d = h;
					var i = c / d,
					j = e / f;
					i < j ? d = Math.round(c / j) : c = Math.round(d * j)
				}
				break;
			case "fw":
				e < h ? (c = e, d = f) : (c = h, d = Math.round(h * f / e));
				break;
			default:
			}
			return {
				w:
				c,
				h: d
			}
		},
		avatar: function(a, b) {
			return a.avatar ? this.imgURL(a.avatar, b || "sq75") : "/img/default_buddy_icon.jpg"
		},
		url: function(a, b) {
			if (~a.indexOf("://")) return a;
			var c = b ? "https": this.scheme;
			return c + "://" + this.host + a
		}
	}),
	a.escape = a._,
	a
} (typeof exports == "undefined" ? window.app: exports),
function(rt) {
	var templates = rt.templates,
	attrs = function() {
		return rt.attrs.apply(rt, arguments)
	},
	_ = function() {
		return rt._.apply(rt, arguments)
	},
	img = function() {
		return rt.img.apply(rt, arguments)
	},
	imgURL = function() {
		return rt.imgURL.apply(rt, arguments)
	},
	imgSize = function() {
		return rt.imgSize.apply(rt, arguments)
	},
	avatar = function() {
		return rt.avatar.apply(rt, arguments)
	},
	url = function() {
		return rt.url.apply(rt, arguments)
	},
	escape = function() {
		return rt.escape.apply(rt, arguments)
	},
	__t = rt.templates,
	emerge = function() {
		return rt.render.apply(rt, arguments)
	};
	__t._board_item = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				"data-id": "" + board.board_id + "",
				"data-seq": "" + board.seq + "",
				"class": "Board wfc"
			})),
			buf.push(">"),
			user && board.user_id == user.user_id && (buf.push("<div"), buf.push(attrs({
				"class": "draglay"
			})), buf.push("></div>")),
			buf.push("<h3>" + escape((interp = board.title) == null ? "": interp) + "</h3>"),
			typeof pin != "undefined" && pin.index_in_board ? (buf.push("<span"), buf.push(attrs({
				"class": "position"
			})), buf.push(">" + escape((interp = pin.index_in_board) == null ? "": interp) + "/" + escape((interp = board.pin_count) == null ? "": interp) + "</span>")) : board.pin_count && (buf.push("<div"), buf.push(attrs({
				"class": "pin-count"
			})), buf.push(">(" + escape((interp = board.pin_count) == null ? "": interp) + ")</div>")),
			buf.push("<a"),
			buf.push(attrs({
				href: "/boards/" + board.board_id + "/",
				"class": "link x"
			})),
			buf.push(">"),
			board.description && (buf.push("<h4"), buf.push(attrs({
				"class": "hidden"
			})), buf.push(">" + escape((interp = board.description) == null ? "": interp) + "</h4>"));
			for (var $index = 0,
			$$l = board.pins.length; $index < $$l; $index++) {
				var pin = board.pins[$index];
				buf.push("<img"),
				buf.push(attrs({
					src: imgURL(pin.file, "sq75")
				})),
				buf.push("/>")
			}
			buf.push("</a>");
			for (var $index = 0,
			$$l = board.pins.length; $index < $$l; $index++) {
				var pin = board.pins[$index];
				buf.push("<a"),
				buf.push(attrs({
					href: "/pins/" + pin.pin_id + "",
					title: "" + pin.raw_text + "",
					"class": "hidden"
				})),
				buf.push("><img"),
				buf.push(attrs({
					title: "" + pin.raw_text + "",
					src: imgURL(pin.file, "sq75")
				})),
				buf.push("/></a>")
			}
			user && (buf.push("<div"), buf.push(attrs({
				"class": "FollowBoard"
			})), buf.push(">"), board.user_id !== user.user_id ? board.following ? (buf.push("<a"), buf.push(attrs({
				"data-id": "" + board.board_id + "",
				href: "#",
				onclick: "return false;",
				"class": "unfollow btn btn13 wbtn"
			})), buf.push("><strong>\u53d6\u6d88\u5173\u6ce8</strong><span></span></a>")) : (buf.push("<a"), buf.push(attrs({
				"data-id": "" + board.board_id + "",
				href: "#",
				onclick: "return false;",
				"class": "follow btn btn13 wbtn"
			})), buf.push("><strong>\u5173\u6ce8</strong><span></span></a>")) : (buf.push("<a"), buf.push(attrs({
				href: "/boards/" + board.board_id + "/edit/",
				"class": "btn btn13 wbtn"
			})), buf.push("><strong>\u7f16\u8f91</strong><span></span></a>")), buf.push("</div>")),
			buf.push("</div>")
		}
		return buf.join("")
	},
	__t._board_picker = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				"class": "BoardListOverlay"
			})),
			buf.push("></div><div"),
			buf.push(attrs({
				"class": "BoardSelector BoardPicker"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "current"
			})),
			buf.push("><span"),
			buf.push(attrs({
				"class": "CurrentBoard"
			})),
			buf.push(">\u9009\u62e9\u753b\u677f...</span><span"),
			buf.push(attrs({
				"class": "DownArrow"
			})),
			buf.push("></span></div><div"),
			buf.push(attrs({
				"class": "BoardList"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "BoardListBody"
			})),
			buf.push("><ul></ul></div><div"),
			buf.push(attrs({
				"class": "CreateBoard"
			})),
			buf.push("><input"),
			buf.push(attrs({
				id: "board_name_input",
				type: "text",
				placeholder: "\u521b\u5efa\u65b0\u753b\u677f"
			})),
			buf.push("/><a"),
			buf.push(attrs({
				href: "#",
				onclick: "return false;",
				"class": "nf btn btn18 wbtn"
			})),
			buf.push("><strong> \u521b\u5efa</strong><span></span></a><div"),
			buf.push(attrs({
				"class": "CreateBoardStatus"
			})),
			buf.push('></div></div></div></div><script>(function(){$$("div.BoardPicker").each(function(a){if(a.retrieve("initialized"))return;var b=a.getElement("div.CreateBoard"),c=$("board_name_input"),d=b.getElement("a.btn"),e=b.getElement(".CreateBoardStatus"),f=$(document.body).getHeight()<400?5:8,g=new BoardPicker(a,{maxVisibleItems:f}),h=new FancyInput(c);(new Button(d,{click:function(){var a=c.get("value").trim();return a==""?(e.set("html","\u8bf7\u8f93\u5165\u540d\u79f0"),!1):(this.disable(),(new Request.JSON({url:"/boards/",data:{title:a},onSuccess:function(a){a.err?alert(a.msg):g.add(a.board).hide()},onFailure:function(){alert("\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5")},onComplete:function(){h.setValue(""),this.enable()}.bind(this)})).post(),!1)}})).disable().bind(h),a.store("initialized",!0)})})()</script>')
		}
		return buf.join("")
	},
	__t._board_view = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_header");
			buf.push(null == __val__ ? "": __val__);
			var board = page.board,
			user = board.user,
			user_url = "/" + user.urlname,
			board_url = "/boards/" + board.board_id;
			if (req.user && !board.category_id) {
				buf.push("<div"),
				buf.push(attrs({
					id: "category_callout"
				})),
				buf.push("><div"),
				buf.push(attrs({
					"class": "wrapper"
				})),
				buf.push("><div"),
				buf.push(attrs({
					"class": "callout"
				})),
				buf.push("><div"),
				buf.push(attrs({
					"class": "form clearfix"
				})),
				buf.push("><p>\u4e3a\u8fd9\u4e2a\u753b\u677f\u6dfb\u52a0\u4e2a\u5206\u7c7b\uff0c\u8ba9\u5176\u4ed6\u4eba\u66f4\u5bb9\u6613\u627e\u5230\u5b83\u3002</p><div"),
				buf.push(attrs({
					"class": "picker"
				})),
				buf.push(">");
				var __val__ = emerge("_category_picker");
				buf.push(null == __val__ ? "": __val__),
				buf.push("</div><div"),
				buf.push(attrs({
					"class": "Submit"
				})),
				buf.push("><a"),
				buf.push(attrs({
					href: "#",
					onclick: "return false;",
					"class": "btn btn18 rbtn"
				})),
				buf.push("><strong> \u63d0\u4ea4</strong><span></span></a></div></div><div"),
				buf.push(attrs({
					style: "display: none;",
					"class": "success"
				})),
				buf.push(">\u5df2\u6210\u529f\u8bbe\u7f6e\u5206\u7c7b\uff0c\u611f\u8c22\u4f60\u7684\u652f\u6301\u3002</div><div"),
				buf.push(attrs({
					"class": "clear"
				})),
				buf.push("></div></div></div></div>")
			}
			buf.push("<div"),
			buf.push(attrs({
				id: "nav_bar"
			})),
			buf.push("><div"),
			buf.push(attrs({
				id: "BoardTitle",
				"class": "wrapper"
			})),
			buf.push("><h1>" + escape((interp = board.title) == null ? "": interp) + "<span"),
			buf.push(attrs({
				"class": "stats"
			})),
			buf.push('>(<span class="count">' + escape((interp = board.pin_count) == null ? "": interp) + "</span> \u4e2a\u91c7\u96c6)</span><em></em></h1><div"),
			buf.push(attrs({
				id: "BoardButton"
			})),
			buf.push("><a"),
			buf.push(attrs({
				id: "board_share_unit",
				"data-id": "" + board.board_id + "",
				"data-name": "" + board.title + "",
				"data-count": "" + board.pin_count + "",
				href: "#",
				onclick: "return false;",
				"class": "btn wbtn"
			})),
			buf.push("><ul"),
			buf.push(attrs({
				"class": "clearfix"
			})),
			buf.push("><li"),
			buf.push(attrs({
				alt: "\u65b0\u6d6a\u5fae\u535a",
				"class": "sina"
			})),
			buf.push(">\u5fae\u535a</li><li"),
			buf.push(attrs({
				alt: "\u8c46\u74e3\u8bf4",
				"class": "douban"
			})),
			buf.push(">\u8c46\u74e3</li><li"),
			buf.push(attrs({
				alt: "QQ\u7a7a\u95f4",
				"class": "qzone"
			})),
			buf.push(">Qzone</li></ul><strong> \u5206\u4eab\u5230</strong><span></span></a>"),
			req.user && board.user_id === req.user.user_id ? (buf.push("<a"), buf.push(attrs({
				href: "" + board_url + "/edit/",
				"class": "edit btn btn13 wbtn"
			})), buf.push("><strong>\u7f16\u8f91\u753b\u677f</strong><span></span></a>")) : board.following ? (buf.push("<a"), buf.push(attrs({
				"data-id": "" + board.board_id + "",
				href: "#",
				onclick: "return false;",
				"class": "unfollow btn wbtn"
			})), buf.push("><strong>\u53d6\u6d88\u5173\u6ce8</strong><span></span></a>")) : (buf.push("<a"), buf.push(attrs({
				"data-id": "" + board.board_id + "",
				href: "#",
				onclick: "return false;",
				"class": "follow btn wbtn"
			})), buf.push("><strong>\u5173\u6ce8</strong><span></span></a>")),
			buf.push("</div></div></div><div"),
			buf.push(attrs({
				"class": "wrapper bl"
			})),
			buf.push("><div"),
			buf.push(attrs({
				id: "waterfall"
			})),
			buf.push("><div"),
			buf.push(attrs({
				id: "BoardMeta",
				"class": "pin wfc topright"
			})),
			buf.push("><h3"),
			buf.push(attrs({
				"class": "nmt"
			})),
			buf.push(">\u521b\u5efa\u8005</h3><div"),
			buf.push(attrs({
				id: "BoardUser"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/" + escape(user.urlname) + "/",
				title: escape(user.username),
				"class": "img x"
			})),
			buf.push("><img"),
			buf.push(attrs({
				src: avatar(user, undefined)
			})),
			buf.push("/></a><span"),
			buf.push(attrs({
				id: "BoardUserName"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "" + user_url + "/",
				title: "" + user.username + "",
				"class": "x"
			})),
			buf.push(">" + escape((interp = user.username) == null ? "": interp) + "</a></span></div>"),
			board.category_id != null && (buf.push("<div"), buf.push(attrs({
				"class": "category-display"
			})), buf.push("><h3>\u6240\u5c5e\u5206\u7c7b</h3><a"), buf.push(attrs({
				href: "/all/" + board.category_id + "",
				"class": "board-category x"
			})), buf.push(">" + escape((interp = board.category_name) == null ? "": interp) + "</a></div>")),
			board.description && (buf.push("<h3>\u753b\u677f\u63cf\u8ff0</h3><p"), buf.push(attrs({
				"class": "board-description"
			})), buf.push(">" + escape((interp = board.description) == null ? "": interp) + "</p>"));
			if (board.followers.length) {
				buf.push("<h3>\u5173\u6ce8\u8005"),
				board.follow_count > board.followers.length && (buf.push("<span>(\u5171" + escape((interp = board.follow_count) == null ? "": interp) + "\u4eba\uff0c<a"), buf.push(attrs({
					href: "/boards/" + board.board_id + "/followers/"
				})), buf.push(">\u67e5\u770b\u6240\u6709</a>)</span>")),
				buf.push("</h3><div"),
				buf.push(attrs({
					id: "BoardUsers"
				})),
				buf.push(">");
				for (var $index = 0,
				$$l = board.followers.length; $index < $$l; $index++) {
					var f = board.followers[$index];
					buf.push("<a"),
					buf.push(attrs({
						href: "/" + escape(f.urlname) + "/",
						title: escape(f.username),
						"class": "img x"
					})),
					buf.push("><img"),
					buf.push(attrs({
						src: avatar(f, undefined)
					})),
					buf.push("/></a>")
				}
				buf.push("</div>")
			}
			if (board.siblings.length) {
				buf.push("<div"),
				buf.push(attrs({
					"class": "clear"
				})),
				buf.push("></div><h3>\u5176\u5b83\u753b\u677f</h3><div"),
				buf.push(attrs({
					id: "BoardBoards"
				})),
				buf.push(">");
				for (var $index = 0,
				$$l = board.siblings.length; $index < $$l; $index++) {
					var b = board.siblings[$index];
					buf.push("<a"),
					buf.push(attrs({
						href: "/boards/" + b.board_id + "/",
						"class": "x"
					})),
					buf.push(">" + escape((interp = b.title.brief(18)) == null ? "": interp) + "<span"),
					buf.push(attrs({
						"class": "stats"
					})),
					buf.push(">" + escape((interp = b.pin_count) == null ? "": interp) + "</span></a>")
				}
				buf.push("</div>")
			}
			buf.push("</div>");
			for (var $index = 0,
			$$l = board.pins.length; $index < $$l; $index++) {
				var pin = board.pins[$index],
				__val__ = emerge("_pin_item", {
					user: user,
					pin: pin,
					board: board
				});
				buf.push(null == __val__ ? "": __val__)
			}
			buf.push('</div></div><script>(function(){app.initFollowButtons(),app.initLikeButtons(),app.initAddCommentButtons(),window.addEvent("domready",function(){function f(){a.slide("out").get("slide").chain(function(){a.hide()})}var a=$("category_callout");if(!a||a.retrieve("initialized"))return;var b=a.getElement(".Submit a"),c=a.getElement(".form"),d=a.getElement(".success"),e=new CategoryPicker(a.getElement("div.CategoryPicker")),g=new Button(b,{click:function(){var a=e.getSelected();return a?(this.disable(),(new Request.JSON({url:"/boards/' + escape((interp = board.board_id) == null ? "": interp) + '/",data:{category:a},onSuccess:function(a){a.err?alert(a.msg):(c.hide(),d.show(),setTimeout(f,2e3))},onFailure:function(){alert("\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5")},onComplete:function(){this.enable()}.bind(this)})).post(),!1):!1}});g.disable(),e.addEvent("select",function(){this.getSelected()?g.enable():g.disable()}),a.store("initialized",!0)})})(),function(a){var b=$("board_share_unit"),c=b.get("data-id"),d=b.get("data-name"),e=b.get("data-count"),f="http://"+app.host+"/boards/"+c+"/";if($$(".pin:not(#BoardMeta) img")[0])var g=$$(".pin:not(#BoardMeta) img")[0].get("src").replace("_fw192","_fw554");var h="\u8fd9\u4e2a\u753b\u677f\u503c\u5f97\u4e00\u770b "+d+"("+e+"\u4e2a\u91c7\u96c6)";$$("#board_share_unit li").addEvent("click",function(){var b=["url="+a(f)];if(this.className=="sina"){var c="http://v.t.sina.com.cn/share/share.php?";b.push("&appkey=2499394483"),g&&b.push("&pic="+a(g)),b.push("&ralateUid=2493118952"),b.push("&title="+a(h))}else if(this.className=="douban"){var c="http://www.douban.com/recommend/?";b.push("&title="+a(h)),b.push("&comment="+a(h))}else if(this.className=="qzone"){var c="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?";b.push("&title="+a(h)),g&&b.push("&pics="+a(g))}b=b.join(""),function(a,d,e){function f(){window.open([c,b].join(""),"mb",["toolbar=0,status=0,resizable=1,width=620,height=450,left=",(a.width-620)/2,",top=",(a.height-450)/2].join(""))||(u.href=[c,b].join(""))}/Firefox/.test(navigator.userAgent)?setTimeout(f,0):f()}(screen,document,encodeURIComponent)})}(encodeURIComponent),app.promotion&&app.promotion()</script>')
		}
		return buf.join("")
	},
	__t._bookmarklet = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				id: "bookmarklet",
				style: "width: 550px; height: 190px; margin: 40px auto;"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "form"
			})),
			buf.push(">");
			var __val__ = emerge("_dialog_pin_bottom", {
				text: page.params.text
			});
			buf.push(null == __val__ ? "": __val__),
			buf.push('</div></div><script>(function(){var a=270;Browser.ie&&(a+=90),Browser.firefox&&(a+=85),Browser.chrome&&(a+=58),Browser.safari&&(a+=80),window.resizeTo(632,a);var b=$("bookmarklet"),c=app.page.params.minWidth,d=app.page.params.minHeight;app.page.params.media_type!="1"&&(c=c<app.settings.minImageWidth?app.settings.minImageWidth:c,d=d<app.settings.minImageWidth?app.settings.minImageWidth:d);var e=b.getElement(".error"),f=b.getElements("img.load"),g=new ImagePicker(b.getElement(".ImagePicker"));g.setOptions({minW:c,minH:d});var h=app.page.params.media,i=function(a){return a.width===""||a.height===""||a.width.toInt()>=c&&a.height.toInt()>=d},j=b.getElement("a.rbtn"),k=function(a){a.length==0?(e.set("html","\u62b1\u6b49\uff0c\u9875\u9762\u4e0a\u6ca1\u6709\u8db3\u591f\u5927\u7684\u56fe\u7247").show(),j&&j.addClass("disabled")):j&&j.removeClass("disabled")};!h||h.length<=0?(f.show(),(new Request.JSON({url:"/pins/create/find_images/",data:{url:app.page.params.url},noCache:!0,onSuccess:function(a){if(a.err){e.set("html",a.msg);return}h=a.images.filter(i).map(function(a){return a.src}),h.length==0?e.set("html","\u62b1\u6b49\uff0c\u9875\u9762\u4e0a\u6ca1\u6709\u8db3\u591f\u5927\u7684\u56fe\u7247").show():g.load(h,app.page.params.url,k)},onComplete:function(a){(typeOf(h)!="array"||h.length==0)&&f.hide()},onFailure:function(){e.set("html","\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5").show(),f.hide()}})).get()):g.load(h,app.page.params.url,k)})()</script><script>(function(){if(app.page.params.is_share_btn)try{var a=app.page.params.url,b="",c=(new RegExp("^https?://([^/]+)(?:/.*)?")).exec(a);c&&c.length==2&&(b=c[1]),_gaq.push(["_trackEvent","SharePinClick",b,app.page.params.url])}catch(d){}})()</script>')
		}
		return buf.join("")
	},
	__t._bookmarklet_success = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_pin_success", {
				pin: app.page.pin
			});
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._browser_notice = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<!--[if lt IE 8]><div"),
			buf.push(attrs({
				id: "browser_notice_callout",
				style: "display:none;"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "wrapper"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "callout"
			})),
			buf.push('><h3>\u60a8\u6b63\u5728\u4f7f\u7528\u77f3\u5668\u65f6\u4ee3\u7684IE\u6d4f\u89c8\u5668\uff0c\u4e3a\u4e86\u66f4\u597d\u7684\u4f53\u9a8c\u82b1\u74e3\uff0c\u63a8\u8350\u4f7f\u7528<a class="browser chrome" target="_blank" href="http://www.google.com/chrome/">Chrome</a>\u3001<a class="browser firefox" target="_blank" href="http://www.mozilla.org/firefox/">Firefox</a>\u7b49\u73b0\u4ee3\u6d4f\u89c8\u5668</h3><span'),
			buf.push(attrs({
				"class": "close"
			})),
			buf.push('></span></div></div></div><![endif]--><script>(function(){window.addEvent("domready",function(){if(Browser.ie&&Browser.version<8){var a=document.id("browser_notice_callout"),b=Cookie.read("__hb_ienotice");console.info(b),b?a.hide():a.show(),a.getElement("span.close").addEvent("click",function(){Cookie.write("__hb_ienotice",1,{duration:1}),a.hide()})}})})()</script>')
		}
		return buf.join("")
	},
	__t._categories_cell = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, cur = null,
			cats = settings.categories,
			channels = settings.channels,
			show_chrome_ad = !1;
			if (page.filter && ~page.filter.indexOf("category:")) {
				var cid = page.filter.split(":").pop();
				for (var i = 0,
				l = cats.length; i < l; i++) if (cats[i].id === cid) {
					cur = cats[i];
					break
				}
				for (var i = 0,
				l = channels.length; i < l; i++) if (channels[i].id === cid) {
					cur = channels[i];
					break
				}
			}
			var keywords = typeof seo_keywords_dic == "undefined" ? {}: seo_keywords_dic;
			buf.push("<div"),
			buf.push(attrs({
				"class": "pin category wfc"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/all/",
				"class": cur ? "": "selected"
			})),
			buf.push(">\u5168\u90e8</a>");
			for (var $index = 0,
			$$l = cats.length; $index < $$l; $index++) {
				var c = cats[$index],
				keyword = typeof keywords[c.id] == "undefined" ? "": keywords[c.id];
				buf.push("<a"),
				buf.push(attrs({
					href: "/" + (c.id === "beauty" ? "favorite": "all") + "/" + c.id + "/",
					title: "" + keyword + "",
					"class": cur && cur.id === c.id ? "selected": ""
				})),
				buf.push(">");
				var __val__ = c.name;
				buf.push(escape(null == __val__ ? "": __val__)),
				buf.push("</a>")
			}
			for (var $index = 0,
			$$l = channels.length; $index < $$l; $index++) {
				var c = channels[$index],
				keyword = typeof keywords[c.id] == "undefined" ? "": keywords[c.id];
				buf.push("<a"),
				buf.push(attrs({
					href: "/all/" + c.id + "/",
					title: "" + keyword + "",
					"class": (cur && cur.id === c.id ? "selected": "") + " " + c.id
				})),
				buf.push("><span>");
				var __val__ = c.name;
				buf.push(escape(null == __val__ ? "": __val__)),
				buf.push("</span></a>"),
				cur && cur.id == "web_captures" && (show_chrome_ad = !0)
			}
			show_chrome_ad && (buf.push("<a"), buf.push(attrs({
				href: "http://huaban.com/about/goodies/chrome/",
				"class": "chrome_crx_ad"
			})), buf.push(">\u4f7f\u7528\u82b1\u74e3Chrome\u6269\u5c55 \u4f60\u4e5f\u53ef\u4ee5\u91c7\u96c6\u7f51\u9875\u622a\u56fe\u54e6</a>")),
			buf.push("</div>")
		}
		return buf.join("")
	},
	__t._category_picker = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				"class": "BoardListOverlay"
			})),
			buf.push("></div><div"),
			buf.push(attrs({
				"class": "BoardSelector BoardPicker CategoryPicker"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "current"
			})),
			buf.push("><span"),
			buf.push(attrs({
				"class": "CurrentBoard"
			})),
			buf.push(">\u9009\u62e9\u5206\u7c7b</span><span"),
			buf.push(attrs({
				"class": "DownArrow"
			})),
			buf.push("></span></div><div"),
			buf.push(attrs({
				"class": "BoardList"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "BoardListBody"
			})),
			buf.push('><ul></ul></div></div></div><script>(function(){$$("div.CategoryPicker").each(function(a){if(a.retrieve("initialized"))return;new CategoryPicker(a),a.store("initialized",!0)})})()</script>')
		}
		return buf.join("")
	},
	__t._comment_form = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				id: "PinAddComment",
				"data-id": pin.pin_id,
				"class": "clearfix"
			})),
			buf.push("><div"),
			buf.push(attrs({
				id: "PinInputArea"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/" + escape(user.urlname) + "/",
				title: escape(user.username),
				"class": "img x"
			})),
			buf.push("><img"),
			buf.push(attrs({
				src: avatar(user, undefined),
				"class": "avatar"
			})),
			buf.push("/></a><div"),
			buf.push(attrs({
				"class": "InputContainer Form FancyForm"
			})),
			buf.push("><textarea"),
			buf.push(attrs({
				id: "CloseupComment",
				name: "caption"
			})),
			buf.push("></textarea><label>\u6dfb\u52a0\u8bc4\u8bba...</label><span"),
			buf.push(attrs({
				"class": "fff"
			})),
			buf.push("></span></div><div"),
			buf.push(attrs({
				id: "PinAddCommentControls",
				style: "display:none;"
			})),
			buf.push("><a"),
			buf.push(attrs({
				id: "PostComment",
				href: "#",
				onclick: "return false;",
				"class": "disabled btn btn13 wbtn"
			})),
			buf.push('><strong> \u6dfb\u52a0\u8bc4\u8bba</strong><span></span></a></div></div></div><script>(function(a){var b=a("PinAddComment");if(b.retrieve("initialized"))return;var c=b.get("data-id"),d=a("PinAddCommentControls"),e=a("pin_comments"),f=a("CloseupComment"),g=new FancyInput("CloseupComment",{onFocus:function(){d.isDisplayed()||d.show(),f.get("registered-at")||(f.set("registered-at","registered"),new Autocompleter.Contacts.At(f))}});(new Button("PostComment",{click:function(){var a=g.getValue().trim();if(a=="")return alert("\u597d\u6b79\u8f93\u4e24\u4e2a\u5b57\u5427\uff0c\u4eb2!"),!1;var b=this.disable();return(new Request.JSON({url:"/pins/"+c+"/comments/",data:{text:a},onSuccess:function(a){if(a.err)alert(a.msg);else{var c=app.render("_comment_item",a.comment),d=Elements.from(c).inject(e);d.highlight(),g.setValue("")}b.enable()},onFailure:function(){alert("\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5"),b.enable()}})).post(),!1}})).disable().bind(g),f.addEvent("keydown",function(a){a.key=="esc"&&a.target.blur();if(a.key=="enter"&&(!Browser.Platform.mac&&a.control||Browser.Platform.mac&&a.meta))return document.id("PostComment").fireEvent("click"),!1}),b.store("initialized",!0)})(document.id)</script>')
		}
		return buf.join("")
	},
	__t._comment_form2 = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				id: "PinAddComment",
				"data-id": pin.pin_id,
				"class": "clearfix"
			})),
			buf.push("><div"),
			buf.push(attrs({
				id: "PinInputArea"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "javascript:;",
				title: "avatar",
				"class": "img"
			})),
			buf.push("><img"),
			buf.push(attrs({
				src: "/img/default_buddy_icon.jpg",
				"class": "avatar"
			})),
			buf.push("/></a><div"),
			buf.push(attrs({
				"class": "InputContainer Form FancyForm"
			})),
			buf.push("><textarea"),
			buf.push(attrs({
				id: "CloseupComment",
				name: "caption",
				attr: "inner:text;keyup:textcheck;keypress:textsel;keydown:textdown",
				disabled: !0
			})),
			buf.push("></textarea><label"),
			buf.push(attrs({
				"class": "unauth"
			})),
			buf.push('>\u56de\u590d\u9700\u8981<a href="javascript:app.forceLogin();">\u767b\u5f55</a>\u6216<a target="_blank" href="/signup/">\u7acb\u5373\u6ce8\u518c\u82b1\u74e3\u5e10\u53f7</a></label><span'),
			buf.push(attrs({
				"class": "fff"
			})),
			buf.push("></span></div><div"),
			buf.push(attrs({
				id: "PinAddCommentControls",
				style: "display:none;"
			})),
			buf.push("><a"),
			buf.push(attrs({
				id: "PostComment",
				href: "#",
				onclick: "return false;",
				"class": "disabled btn btn13 wbtn"
			})),
			buf.push("><strong> \u6dfb\u52a0\u8bc4\u8bba</strong><span></span></a></div></div></div>")
		}
		return buf.join("")
	},
	__t._comment_item = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, _metas = typeof metas == "undefined" ? null: metas;
			buf.push("<div"),
			buf.push(attrs({
				"data-id": comment_id,
				"class": "comment clearfix"
			})),
			buf.push("><div"),
			buf.push(attrs({
				id: "comment_action_btns",
				"class": "fr"
			})),
			buf.push("><a"),
			buf.push(attrs({
				"data-name": user.username,
				title: "\u56de\u590d",
				"class": "pinViewReplyButton"
			})),
			buf.push("></a>"),
			this.req.user && (user_id === this.req.user.user_id || pin.user_id === this.req.user.user_id) && (buf.push("<a"), buf.push(attrs({
				"data-url": "/pins/" + pin_id + "/comments/" + comment_id + "/",
				title: "\u5220\u9664",
				"class": "DeleteComment"
			})), buf.push("></a>")),
			buf.push("</div><a"),
			buf.push(attrs({
				href: "/" + escape(user.urlname) + "/",
				title: escape(user.username),
				"class": "img x"
			})),
			buf.push("><img"),
			buf.push(attrs({
				src: avatar(user, undefined),
				"class": "avatar"
			})),
			buf.push("/></a><p"),
			buf.push(attrs({
				"class": "meta"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/" + user.urlname + "/",
				"class": "author"
			})),
			buf.push(">" + escape((interp = user.username) == null ? "": interp) + "</a>&nbsp;-&nbsp;<span"),
			buf.push(attrs({
				"data-ts": "" + created_at + "",
				"class": "ts-words"
			})),
			buf.push(">" + escape((interp = Date.timeAgo(created_at)) == null ? "": interp) + "</span>\u8bf4\uff1a</p><p"),
			buf.push(attrs({
				"class": "text"
			})),
			buf.push(">");
			var __val__ = raw_text.format_text(_metas);
			buf.push(null == __val__ ? "": __val__),
			buf.push("</p></div>")
		}
		return buf.join("")
	},
	__t._comment_item_convo = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, _metas = typeof metas == "undefined" ? null: metas;
			buf.push("<div"),
			buf.push(attrs({
				"class": "comment convo clearfix"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/" + escape(user.urlname) + "/",
				title: escape(user.username),
				"class": "img x"
			})),
			buf.push("><img"),
			buf.push(attrs({
				src: avatar(user, undefined)
			})),
			buf.push("/></a><p><a"),
			buf.push(attrs({
				href: "/" + user.urlname + "/",
				"class": "author"
			})),
			buf.push(">" + escape((interp = user.username) == null ? "": interp) + "</a>:&nbsp;");
			var __val__ = raw_text.format_text(_metas);
			buf.push(null == __val__ ? "": __val__),
			buf.push("</p><a"),
			buf.push(attrs({
				title: "\u56de\u590d",
				"class": "replyButton"
			})),
			buf.push("></a></div>")
		}
		return buf.join("")
	},
	__t._dialog_add = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_dialog_frame", {
				id: "Add",
				title: "\u91c7\u96c6",
				body: emerge("_dialog_add_body"),
				className: "PaddingLess"
			});
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._dialog_add_body = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<p"),
			buf.push(attrs({
				id: "PinIt"
			})),
			buf.push(">\u4f7f\u7528\u4e66\u7b7e\u5c0f\u5de5\u5177\u5728\u6d4f\u89c8\u5176\u5b83\u7f51\u7ad9\u65f6\u76f4\u63a5\u91c7\u96c6\u4e0a\u9762\u7684\u56fe\u7247<a"),
			buf.push(attrs({
				href: "/about/goodies/"
			})),
			buf.push(">\u70b9\u51fb\u8fd9\u91cc</a>\u6dfb\u52a0\u4e66\u7b7e\u5de5\u5177</p><div"),
			buf.push(attrs({
				id: "OpenLinks"
			})),
			buf.push("><a"),
			buf.push(attrs({
				id: "OpenScrapePin",
				onclick: "app.showDialog('scrape_pin');return false;",
				"class": "cell"
			})),
			buf.push("><div"),
			buf.push(attrs({
				id: "scrape",
				"class": "icon"
			})),
			buf.push("></div><span>\u7f51\u5740\u91c7\u96c6</span></a><a"),
			buf.push(attrs({
				id: "OpenUploadPin",
				onclick: "app.showDialog('upload_pin');return false;",
				"class": "cell"
			})),
			buf.push("><div"),
			buf.push(attrs({
				id: "upload",
				"class": "icon"
			})),
			buf.push("></div><span>\u4e0a\u4f20\u91c7\u96c6</span></a><a"),
			buf.push(attrs({
				id: "OpenCreateBoard",
				onclick: "app.showDialog('create_board');return false;",
				"class": "cell"
			})),
			buf.push("><div"),
			buf.push(attrs({
				id: "board",
				"class": "icon"
			})),
			buf.push("></div><span>\u65b0\u5efa\u753b\u677f</span></a></div>")
		}
		return buf.join("")
	},
	__t._dialog_create_board = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_dialog_frame", {
				id: "CreateBoard",
				title: "\u521b\u5efa\u753b\u677f",
				body: emerge("_dialog_create_board_body"),
				destroyOnClose: !0
			});
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._dialog_create_board_body = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<form"),
			buf.push(attrs({
				action: "",
				"class": "Form StaticForm nm"
			})),
			buf.push("><ul><li"),
			buf.push(attrs({
				"class": "nbt"
			})),
			buf.push("><input"),
			buf.push(attrs({
				id: "id_board_title",
				type: "text",
				name: "title",
				value: ""
			})),
			buf.push("/><label>\u753b\u677f\u6807\u9898</label><span"),
			buf.push(attrs({
				"class": "fff"
			})),
			buf.push("></span></li><li><input"),
			buf.push(attrs({
				id: "id_category",
				type: "hidden",
				name: "category",
				value: ""
			})),
			buf.push("/>");
			var __val__ = emerge("_category_picker");
			buf.push(null == __val__ ? "": __val__),
			buf.push("<label>\u753b\u677f\u5206\u7c7b</label></li></ul><div"),
			buf.push(attrs({
				"class": "Submit"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "#",
				onclick: "return false;",
				"class": "btn btn18 wbtn"
			})),
			buf.push("><strong>\u521b\u5efa\u753b\u677f</strong><span></span></a><div"),
			buf.push(attrs({
				"class": "CreateBoardStatus msgr"
			})),
			buf.push('></div></div></form><script>(function(){var a=$("CreateBoard");if(a.retrieve("initialized"))return;var b=$("id_board_title"),c=a.getElement(".CategoryPicker"),d=a.getElement("div.msgr"),e=new CategoryPicker(c);new Button(a.getElement(".Submit a"),{click:function(){var a=b.get("value").trim();if(a=="")return d.set("html","\u8bf7\u8f93\u5165\u540d\u79f0"),!1;var c=e.getSelected();return c?(this.disable(),(new Request.JSON({url:"/boards/",data:{title:a,category:c},onSuccess:function(a){a.err?d.set("html",a.msg):window.location="/boards/"+a.board.board_id+"/"},onFailure:function(){d.set("html","\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5")},onComplete:function(){this.enable()}.bind(this)})).post(),!1):(d.set("html","\u8bf7\u9009\u62e9\u5206\u7c7b"),!1)}}),a.store("initialized",!0)})()</script>')
		}
		return buf.join("")
	},
	__t._dialog_frame = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				id: "" + id + "",
				style: "display:none;",
				"class": "ModalContainer " + (typeof destroyOnClose == "undefined" ? "": " destroy")
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "modal wide " + (typeof className == "undefined" ? "": " " + className)
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "header"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "#",
				onclick: "app.hideDialog(); return false",
				"class": "close"
			})),
			buf.push("><strong>Close</strong><span></span></a><h2>" + escape((interp = title) == null ? "": interp) + "</h2></div>");
			var __val__ = body;
			buf.push(null == __val__ ? "": __val__),
			buf.push("</div><div"),
			buf.push(attrs({
				"class": "overlay"
			})),
			buf.push("></div></div>")
		}
		return buf.join("")
	},
	__t._dialog_mv = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				id: "mv_holder",
				style: "display:none;",
				"class": "ModalContainer"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "modal wide"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "header"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "#",
				onclick: "app.hideDialog(); return false",
				"class": "close"
			})),
			buf.push("><strong>Close</strong><span></span></a><h2>\u4e86\u89e3\u82b1\u74e3</h2></div>"),
			navigator.userAgent.toLowerCase().match("ipad") ? (buf.push("<video"), buf.push(attrs({
				id: "youku-html5-player-video",
				width: "450px",
				height: "300px",
				"x-webkit-airplay": "allow",
				controls: "",
				autoplay: "",
				preload: "",
				src: "http://www.youku.com/player/getM3U8/vid/80315531/type/flv/v.m3u8"
			})), buf.push("></video>")) : (buf.push("<embed"), buf.push(attrs({
				src: "http://player.youku.com/player.php/sid/XMzIxMjYyMTI0/v.swf",
				allowFullScreen: "true",
				quality: "high",
				width: "480",
				height: "400",
				align: "middle",
				type: "application/x-shockwave-flash",
				flashvars: "winType=index",
				style: "visibility:visible;"
			})), buf.push("></embed>")),
			buf.push("</div><div"),
			buf.push(attrs({
				"class": "overlay"
			})),
			buf.push("></div></div>")
		}
		return buf.join("")
	},
	__t._dialog_pin_bottom = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				style: "display:none",
				"class": "pbt"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "ImagePicker"
			})),
			buf.push("><img"),
			buf.push(attrs({
				src: "/img/load2.gif",
				alt: "Loading Indicator",
				"class": "load"
			})),
			buf.push("/><div"),
			buf.push(attrs({
				"class": "Images pin carousel-container"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "carousel-clip"
			})),
			buf.push("><ul"),
			buf.push(attrs({
				"class": "carousel-list"
			})),
			buf.push("><li><img"),
			buf.push(attrs({
				src: "/img/DefaultPin.gif",
				alt: "Media"
			})),
			buf.push("/></li></ul></div></div><div"),
			buf.push(attrs({
				"class": "Arrows"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "#",
				"class": "imagePickerNext picker"
			})),
			buf.push(">\u4e0b\u4e00\u5f20&nbsp;\u2192<span"),
			buf.push(attrs({
				"class": "imagePickerNextArrow"
			})),
			buf.push("></span></a><a"),
			buf.push(attrs({
				href: "#",
				"class": "imagePickerPrevious picker"
			})),
			buf.push(">\u2190&nbsp;\u4e0a\u4e00\u5f20<span"),
			buf.push(attrs({
				"class": "imagePickerPreviousArrow"
			})),
			buf.push("></span></a></div></div><div"),
			buf.push(attrs({
				"class": "pin-form"
			})),
			buf.push(">");
			var __val__ = emerge("_board_picker");
			buf.push(null == __val__ ? "": __val__),
			buf.push("<div"),
			buf.push(attrs({
				"class": "InputArea"
			})),
			buf.push("><ul"),
			buf.push(attrs({
				"class": "Form FancyForm"
			})),
			buf.push("><li"),
			buf.push(attrs({
				"class": "nmb"
			})),
			buf.push("><textarea"),
			buf.push(attrs({
				rows: "2",
				name: "caption",
				"class": "DescriptionTextarea"
			})),
			buf.push(">" + escape((interp = typeof text != "undefined" ? text: "") == null ? "": interp) + "</textarea><label>\u63cf\u8ff0\u4e00\u4e0b\u8fd9\u4e2a\u91c7\u96c6\u2026</label><span"),
			buf.push(attrs({
				"class": "fff"
			})),
			buf.push("></span></li></ul></div><div"),
			buf.push(attrs({
				"class": "CreateBoardStatus error mainerror"
			})),
			buf.push("></div><div"),
			buf.push(attrs({
				"class": "Buttons"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "#",
				onclick: "return false;",
				"class": "btn btn18 rbtn"
			})),
			buf.push("><strong> \u91c7\u4e0b\u6765</strong><span></span></a>"),
			this.req.user.bindings.weibo && (buf.push("<label"), buf.push(attrs({
				"class": "weibo less"
			})), buf.push("><input"), buf.push(attrs({
				type: "checkbox",
				name: "pubish_to_weibo",
				"class": "publish_to_weibo"
			})), buf.push("/><span>\u5206\u4eab\u7ed9\u5fae\u535a\u7c89\u4e1d</span></label>")),
			buf.push('</div></div></div><script>(function(){var a=app.page.params&&app.page.params.via||null,b=app.page.params&&app.page.params.file_ticket||null;$$("div.pbt").each(function(c){if(c.retrieve("initialized"))return;var d=$("bookmarklet")!==null,e=c.getElement("textarea.DescriptionTextarea"),f=function(){var a=!1;return function(b,c){c=typeof c=="function"?c:function(){};if(a)return c();a=!0,setTimeout(function(){(new Request.JSON({url:"/feedback/pin",data:b,onSuccess:function(a){c()},onFailure:function(){a=!1,c()}})).post()},5e3)}}(),g=new ImagePicker(c.getElement(".ImagePicker"));new FancyInput(e),e.get("registered-at")||(e.set("registered-at","registered"),new Autocompleter.Contacts.At(e));var h=c.getElement(".publish_to_weibo");h&&(h.addEvent("change",function(){var a=this.getParent("label");this.get("checked")?a.addClass("enabled"):a.removeClass("enabled")}),Cookie.read("share_to_weibo")=="true"&&(h.set("checked","checked"),h.fireEvent("change")));var i=new Button(c.getElement("div.Buttons a.rbtn"),{click:function(){var h=e.get("value"),i=(new BoardPicker(c.getElement(".BoardPicker"))).getSelected(),j=g.getSelected();if(!j)return alert("\u6ca1\u6709\u9009\u62e9\u8981\u91c7\u96c6\u7684\u56fe\u7247");var k={board_id:i,text:h},l=j.el.retrieve("file"),m=j.el.retrieve("pin_id"),n=c.getElement(".publish_to_weibo"),o=c.getElement(".publish_to_douban");n&&n.get("checked")&&(k.weibo=!0),o&&o.get("checked")&&(k.douban=!0);var p={duration:30};n&&Cookie.write("share_to_weibo",k.weibo,p),o&&Cookie.write("share_to_douban",k.douban,p),k.via=d?2:1,a?k.via=a:k.via=d?2:1,k.media_type=app.page.params&&app.page.params.media_type?app.page.params.media_type:0,k.video=app.page.params&&app.page.params.video?app.page.params.video:0,m?k.via=m:b?(k.file_ticket=b,k.link=app.page.params.url):l?k.file_id=l.id:(k.img_url=j.src,j.link&&(k.link=j.link)),d&&(k.is_share_btn=app.page.params.is_share_btn?"1":"");var q=this;return q.setTitle("\u91c7\u96c6\u4e2d...").disable(),(new Request.JSON({url:"/pins/",data:k,onSuccess:function(a){if(a.err){alert(a.msg),f(Object.merge(k,a),function(){q.setTitle().enable()});return}app.$pin=a.pin,d?app.route("/bookmarklet_success"):app.showDialog("pin_success")},onFailure:function(a){f(Object.merge(k,{err:a.status}),function(){q.setTitle().enable()})}})).post(),!1}});b||(i.disable(),g.addEvents({startLoading:function(){i.disable()},finishLoading:function(){i.enable()}})),c.store("initialized",!0)})})()</script>')
		}
		return buf.join("")
	},
	__t._dialog_pin_success = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_dialog_frame", {
				id: "PinSuccess",
				title: "\u91c7\u96c6\u6210\u529f",
				destroyOnClose: !0,
				body: emerge("_pin_success")
			});
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._dialog_repin = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_dialog_frame", {
				id: "Repin",
				title: "\u8f6c\u91c7",
				destroyOnClose: !0,
				body: emerge("_dialog_repin_body")
			});
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._dialog_repin_body = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_dialog_pin_bottom");
			buf.push(null == __val__ ? "": __val__),
			buf.push('<script>(function(){var a=$("Repin");if(a.retrieve("onShow"))return;var b=a.getElements("img.load"),c=a.getElement(".pbt"),d=a.getElement("textarea.DescriptionTextarea"),e=new ImagePicker(a.getElement(".ImagePicker"));a.store("onShow",function(a){b.show(),c.show(),(new Request.JSON({url:"/pins/"+a+"/repin/",noCache:!0,onSuccess:function(c){c.err&&(app.hideDialog(),alert(c.msg)),b.hide(),e.load(app.imgURL(c.pin.file,"fw192"),null,!1,function(b){b&&b[0]&&b[0].store("pin_id",a)}),(new FancyInput(d)).setValue(c.pin.raw_text),d.get("registered-at")||(d.set("registered-at","registered"),new Autocompleter.Contacts.At(d))}})).get()})})()</script>')
		}
		return buf.join("")
	},
	__t._dialog_scrape_pin = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_dialog_frame", {
				id: "ScrapePin",
				title: "\u7f51\u5740\u91c7\u96c6",
				destroyOnClose: !0,
				body: emerge("_dialog_scrape_pin_body")
			});
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._dialog_scrape_pin_body = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				"class": "PinTop inputHolder scrapePin"
			})),
			buf.push("><ul"),
			buf.push(attrs({
				"class": "Form FancyForm"
			})),
			buf.push("><li><img"),
			buf.push(attrs({
				src: "/img/load2.gif",
				alt: "Loading Indicator",
				"class": "load"
			})),
			buf.push("/><a"),
			buf.push(attrs({
				id: "ScrapeButton",
				href: "#",
				onclick: "return false;",
				"class": "fr btn btn18 wbtn"
			})),
			buf.push("><strong> \u67e5\u627e\u56fe\u7247</strong><span></span></a><input"),
			buf.push(attrs({
				id: "scrapePinInput",
				type: "text"
			})),
			buf.push("/><label>http://</label><span"),
			buf.push(attrs({
				"class": "fff"
			})),
			buf.push("></span></li></ul></div>");
			var __val__ = emerge("_dialog_pin_bottom");
			buf.push(null == __val__ ? "": __val__),
			buf.push('<script>(function(){var a=$("ScrapePin");if(a.retrieve("initialized"))return;var b=app.settings.minImageWidth,c=$("scrapePinInput"),d=a.getElement(".error"),e=a.getElements("img.load"),f=a.getElement(".pbt"),g=new ImagePicker(a.getElement(".ImagePicker"),{minW:b}),h=(new Button($("ScrapeButton"),{click:function(){var a=c.get("value").trim();if(a=="")return d.set("html","\u8bf7\u8f93\u5165URL"),!1;var f=this.disable();return e.show(),(new Request.JSON({url:"/pins/create/find_images/",data:{url:a},noCache:!0,onSuccess:function(c){if(c.err){d.set("html",c.msg),f.enable(),e.hide();return}var h=c.images.filter(function(a){return a.width==""||a.height==""||a.width.toInt()>=b||a.height.toInt()>=b}).map(function(a){return a.src});g.load(h,a)},onFailure:function(){d.set("html","\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5"),f.enable(),e.hide()}})).get(),!1}})).disable().bind(new FancyInput(c));g.addEvents({startLoading:function(){h.disable(),f.show()},finishLoading:function(){h.enable(),e.hide(),f.show()}}),a.store("initialized",!0)})()</script>')
		}
		return buf.join("")
	},
	__t._dialog_upload_pin = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_dialog_frame", {
				id: "UploadPin",
				title: "\u4e0a\u4f20\u91c7\u96c6",
				destroyOnClose: !0,
				body: emerge("_dialog_upload_pin_body")
			});
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._dialog_upload_pin_body = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				"class": "PinTop"
			})),
			buf.push("><a"),
			buf.push(attrs({
				id: "upload_button",
				href: "#",
				onclick: "return false;",
				"class": "btn btn18 wbtn"
			})),
			buf.push('><strong> \u9009\u62e9\u56fe\u7247\u6587\u4ef6</strong><span></span></a></div><script>(function(){var a=$("UploadPin");if(a.retrieve("initialized"))return;var b=$("upload_button"),c=a.getElements("img.load"),d=a.getElement(".pbt"),e=new ImagePicker(a.getElement(".ImagePicker")),f=new Uploadr(b);f.addEvents({start:function(){c.show(),d.show()},failed:function(a){c.hide(),d.hide(),alert("\u4e0a\u4f20\u51fa\u9519: "+a.msg)},complete:function(a){c.hide(),e.load([app.imgURL(a,"fw192")],null,!1,function(b){b&&b[0]&&b[0].store("file",a)})}}),a.store("initialized",!0)})()</script>');
			var __val__ = emerge("_dialog_pin_bottom");
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._error = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				"class": "error-page"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/"
			})),
			buf.push("><h1"),
			buf.push(attrs({
				id: "thin_logo"
			})),
			buf.push("></h1></a><div"),
			buf.push(attrs({
				"class": "logo-bar"
			})),
			buf.push("></div><div"),
			buf.push(attrs({
				"class": "error"
			})),
			buf.push(">");
			var __val__ = page.msg;
			buf.push(null == __val__ ? "": __val__),
			buf.push("</div></div>")
		}
		return buf.join("")
	},
	__t._feed_list = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<ol"),
			buf.push(attrs({
				"class": "activity"
			})),
			buf.push(">");
			for (var $index = 0,
			$$l = feeds.length; $index < $$l; $index++) {
				var f = feeds[$index],
				u = user || f.user,
				t = f.content.type,
				p = f.pin,
				b = f.board,
				fu = f.follow_user,
				tu = this.req.user ? this.req.user.user_id: -1,
				ulink = '<a href="/' + u.urlname + '/">' + (tu === u.user_id ? "\u4f60": u.username) + "</a>";
				if (t == "pin") {
					buf.push("<li><a"),
					buf.push(attrs({
						href: "/pins/" + p.pin_id + "/",
						"class": "img"
					})),
					buf.push("><img"),
					buf.push(attrs({
						src: imgURL(p.file, "sq75")
					})),
					buf.push("/></a>");
					var __val__ = ulink;
					buf.push(null == __val__ ? "": __val__),
					buf.push("&nbsp;\u91c7\u96c6&nbsp;<a"),
					buf.push(attrs({
						href: "/pins/" + p.pin_id + "/"
					})),
					buf.push(">");
					var __val__ = p.raw_text.brief(20);
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a>&nbsp;\u5230&nbsp;<a"),
					buf.push(attrs({
						href: "/boards/" + p.board_id + "/"
					})),
					buf.push(">");
					var __val__ = p.board.title.brief(18);
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a></li>")
				} else if (t == "repin") {
					var vu = p.via_user,
					vul = '<a href="/' + vu.urlname + '/">' + (tu === vu.user_id ? "\u4f60": vu.username) + "</a>";
					buf.push("<li><a"),
					buf.push(attrs({
						href: "/pins/" + p.pin_id + "/",
						"class": "img"
					})),
					buf.push("><img"),
					buf.push(attrs({
						src: imgURL(p.file, "sq75")
					})),
					buf.push("/></a>");
					var __val__ = ulink;
					buf.push(null == __val__ ? "": __val__),
					buf.push("&nbsp;\u901a\u8fc7&nbsp;");
					var __val__ = vul;
					buf.push(null == __val__ ? "": __val__),
					buf.push("&nbsp;\u8f6c\u91c7\u4e86&nbsp;<a"),
					buf.push(attrs({
						href: "/pins/" + p.pin_id + "/"
					})),
					buf.push(">");
					var __val__ = p.raw_text.brief(20);
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a>&nbsp;\u5230&nbsp;<a"),
					buf.push(attrs({
						href: "/boards/" + p.board_id + "/"
					})),
					buf.push(">");
					var __val__ = p.board.title.brief(18);
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a></li>")
				} else if (t == "like") {
					buf.push("<li><a"),
					buf.push(attrs({
						href: "/pins/" + p.pin_id + "/",
						"class": "img"
					})),
					buf.push("><img"),
					buf.push(attrs({
						src: imgURL(p.file, "sq75")
					})),
					buf.push("/></a>");
					var __val__ = ulink;
					buf.push(null == __val__ ? "": __val__),
					buf.push("&nbsp;\u559c\u6b22\u7531&nbsp;<a"),
					buf.push(attrs({
						href: "/" + p.user.urlname + "/"
					})),
					buf.push(">");
					var __val__ = tu === p.user.user_id ? "\u4f60": p.user.username;
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a>&nbsp;\u91c7\u96c6\u7684&nbsp;<a"),
					buf.push(attrs({
						href: "/pins/" + p.pin_id + "/"
					})),
					buf.push(">");
					var __val__ = p.raw_text.brief(20);
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a></li>")
				} else if (t == "comment") {
					buf.push("<li><a"),
					buf.push(attrs({
						href: "/pins/" + p.pin_id + "/",
						"class": "img"
					})),
					buf.push("><img"),
					buf.push(attrs({
						src: imgURL(p.file, "sq75")
					})),
					buf.push("/></a>");
					var __val__ = ulink;
					buf.push(null == __val__ ? "": __val__),
					buf.push("&nbsp;\u8bc4\u8bba\u4e86\u7531&nbsp;<a"),
					buf.push(attrs({
						href: "/" + p.user.urlname + "/"
					})),
					buf.push(">");
					var __val__ = tu === p.user.user_id ? "\u4f60": p.user.username;
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a>&nbsp;\u91c7\u96c6\u7684&nbsp;<a"),
					buf.push(attrs({
						href: "/pins/" + p.pin_id + "/"
					})),
					buf.push(">");
					var __val__ = p.raw_text.brief(20);
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a></li>")
				} else if (t == "follow") {
					buf.push("<li>");
					var __val__ = ulink;
					buf.push(null == __val__ ? "": __val__),
					buf.push("&nbsp;\u5173\u6ce8\u4e86&nbsp;<a"),
					buf.push(attrs({
						href: "/" + b.user.urlname + "/"
					})),
					buf.push(">");
					var __val__ = tu === b.user.user_id ? "\u4f60": b.user.username;
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a>&nbsp;\u7684\u753b\u677f&nbsp;<a"),
					buf.push(attrs({
						href: "/boards/" + b.board_id + "/"
					})),
					buf.push(">");
					var __val__ = b.title.brief(18);
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a></li>")
				} else if (t == "follow_people") {
					buf.push("<li>");
					var __val__ = ulink;
					buf.push(null == __val__ ? "": __val__),
					buf.push("&nbsp;\u5173\u6ce8\u4e86&nbsp;<a"),
					buf.push(attrs({
						href: "/" + fu.urlname + "/"
					})),
					buf.push(">");
					var __val__ = tu === fu.user_id ? "\u4f60": fu.username;
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a></li>")
				}
			}
			buf.push("</ol>")
		}
		return buf.join("")
	},
	__t._header = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				id: "header"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "wrapper"
			})),
			buf.push("><a"),
			buf.push(attrs({
				id: "huaban",
				href: "/"
			})),
			buf.push("><img"),
			buf.push(attrs({
				src: "/img/logo_38.png",
				width: "80",
				height: "26",
				alt: "\u82b1\u74e3"
			})),
			buf.push("/></a><div"),
			buf.push(attrs({
				id: "menu_bar"
			})),
			buf.push("><ul"),
			buf.push(attrs({
				id: "menu",
				"class": "menu"
			})),
			buf.push(">");
			if (req.user) {
				var urlbase = "/" + req.user.urlname;
				buf.push("<li"),
				buf.push(attrs({
					id: "nav_user"
				})),
				buf.push("><a"),
				buf.push(attrs({
					href: "" + urlbase + "/",
					"class": "nav"
				})),
				buf.push("><img"),
				buf.push(attrs({
					src: avatar(req.user, undefined)
				})),
				buf.push("/><span>" + escape((interp = req.user.username) == null ? "": interp) + "</span><em></em></a><ul><li><a"),
				buf.push(attrs({
					href: "" + urlbase + "/"
				})),
				buf.push(">\u753b\u677f</a></li><li><a"),
				buf.push(attrs({
					href: "" + urlbase + "/pins/"
				})),
				buf.push(">\u91c7\u96c6</a></li><li><a"),
				buf.push(attrs({
					href: "" + urlbase + "/likes/"
				})),
				buf.push(">\u559c\u6b22</a></li><li"),
				buf.push(attrs({
					"class": "mentions divider"
				})),
				buf.push("><a"),
				buf.push(attrs({
					href: "/message/mentions/",
					"class": "x"
				})),
				buf.push(">@\u6211\u7684</a></li><li"),
				buf.push(attrs({
					"class": "activities"
				})),
				buf.push("><a"),
				buf.push(attrs({
					href: "/message/activities/",
					"class": "x"
				})),
				buf.push(">\u6211\u7684\u6d88\u606f</a></li><li"),
				buf.push(attrs({
					"class": "divider"
				})),
				buf.push("><a"),
				buf.push(attrs({
					href: "/invites"
				})),
				buf.push(">\u9080\u8bf7&amp;\u67e5\u627e\u597d\u53cb</a></li><li"),
				buf.push(attrs({
					"class": "divider"
				})),
				buf.push("><a"),
				buf.push(attrs({
					href: "/settings/"
				})),
				buf.push(">\u5e10\u53f7\u8bbe\u7f6e</a></li><li><a"),
				buf.push(attrs({
					href: "/logout/"
				})),
				buf.push(">\u9000\u51fa\u767b\u5f55</a></li></ul></li>")
			} else buf.push("<li"),
			buf.push(attrs({
				id: "nav_login"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/login/",
				"class": "nav"
			})),
			buf.push("><span>\u767b\u5f55</span><em></em></a><ul><li><a"),
			buf.push(attrs({
				href: "/login/"
			})),
			buf.push(">\u767b\u5f55</a></li><li><a"),
			buf.push(attrs({
				href: "signup"
			})),
			buf.push(">\u7acb\u5373\u6ce8\u518c</a></li></ul></li>");
			buf.push("<li"),
			buf.push(attrs({
				id: "nav_about"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/about/",
				"class": "nav"
			})),
			buf.push("><span>\u5173\u4e8e</span><em></em></a><ul><li><a"),
			buf.push(attrs({
				href: "/about/"
			})),
			buf.push(">\u5173\u4e8e\u82b1\u74e3</a></li><li><a"),
			buf.push(attrs({
				href: "/about/goodies/"
			})),
			buf.push(">\u91c7\u96c6\u5de5\u5177</a></li><li><a"),
			buf.push(attrs({
				href: "/about/goodies/chrome/"
			})),
			buf.push(">Chrome\u6269\u5c55</a></li><li><a"),
			buf.push(attrs({
				href: "/about/help/"
			})),
			buf.push(">\u5e2e\u52a9</a></li><li><a"),
			buf.push(attrs({
				href: "/about/contact/"
			})),
			buf.push(">\u8054\u7cfb\u6211\u4eec</a></li><li><a"),
			buf.push(attrs({
				href: "/pins/53553/"
			})),
			buf.push(">\u7528\u6237\u53cd\u9988</a></li></ul></li><li"),
			buf.push(attrs({
				id: "nav_mobile"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/apps/",
				"class": "nav"
			})),
			buf.push("><span>\u624b\u673a</span><em></em></a><ul><li><a"),
			buf.push(attrs({
				href: "/apps/"
			})),
			buf.push(">iPhone \u5ba2\u6237\u7aef</a></li><li><a"),
			buf.push(attrs({
				href: "/apps/"
			})),
			buf.push(">Android \u5ba2\u6237\u7aef</a></li></ul></li>"),
			req.user && (buf.push("<li"), buf.push(attrs({
				id: "nav_add"
			})), buf.push("><a"), buf.push(attrs({
				href: "#",
				title: "\u6dfb\u52a0",
				onclick: "app.showDialog('add');return false;",
				"class": "nav"
			})), buf.push(">\u6dfb\u52a0</a></li>")),
			buf.push("</ul><div"),
			buf.push(attrs({
				id: "search"
			})),
			buf.push("><form"),
			buf.push(attrs({
				id: "search_form",
				method: "get",
				action: page.query ? page.$url: "/search/",
				"class": "text"
			})),
			buf.push("><input"),
			buf.push(attrs({
				id: "query",
				type: "text",
				size: "27",
				name: "q",
				autocomplete: "off",
				placeholder: "\u641c\u7d22\u4f60\u559c\u6b22\u7684",
				value: page.query ? _(page.query.text) : "",
				"class": "default_value"
			})),
			buf.push("/><a"),
			buf.push(attrs({
				id: "search_lens",
				href: "#",
				onclick: "$('search_form').submit();return false;"
			})),
			buf.push("></a></form></div></div></div></div>");
			if (!req.user) {
				var __val__ = emerge("_unauth_callout");
				buf.push(null == __val__ ? "": __val__)
			} else if (req.user && req.user.status.sts) {
				var __val__ = emerge("_user_fix_callout");
				buf.push(null == __val__ ? "": __val__)
			} else {
				var __val__ = emerge("_browser_notice");
				buf.push(null == __val__ ? "": __val__)
			}
			if (page.show_categories_bar) {
				var __val__ = emerge("_nav_bar");
				buf.push(null == __val__ ? "": __val__)
			}
			req.user && !page.hideNewIndicator && buf.push('<script>(function(){window.addEvent("domready",function(){app.req.user&&!app.messager&&(app.messager=new MessageChecker),app.messager&&app.messager.showIndicator(!0)})})()</script>')
		}
		return buf.join("")
	},
	__t._index = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			if (page.notify && page.notify.notify_id && page.notify.strike || req.user && req.user.status && req.user.status.notify && req.user.status.notify.strike) {
				var __val__ = emerge("_notification_view");
				buf.push(null == __val__ ? "": __val__)
			}
			var __val__ = emerge("_header");
			buf.push(null == __val__ ? "": __val__),
			buf.push("<div"),
			buf.push(attrs({
				"class": "wrapper"
			})),
			buf.push(">");
			var site = ~page.filter.indexOf("site:") ? page.filter.substr(9) : null;
			site && (buf.push("<div"), buf.push(attrs({
				id: "ctx_bar",
				"class": "board"
			})), buf.push("><p>\u6765\u81ea<a"), buf.push(attrs({
				href: "http://" + site + "",
				target: "_blank",
				rel: "nofollow"
			})), buf.push(">" + escape((interp = site) == null ? "": interp) + "</a>\u7684\u91c7\u96c6</p></div>")),
			buf.push("<div"),
			buf.push(attrs({
				id: "waterfall"
			})),
			buf.push(">");
			if (!page.boards && ~page.filter.indexOf(":category")) {
				var __val__ = emerge("_categories_cell");
				buf.push(null == __val__ ? "": __val__)
			}
			if (page.feeds && page.feeds.length) {
				buf.push("<!--#user_feeds.pin.wfc<h3"),
				buf.push(attrs({
					"class": "nmt"
				})),
				buf.push(">\u6700\u65b0\u52a8\u6001</h3>");
				var __val__ = emerge("_feed_list", {
					feeds: page.feeds,
					user: null
				});
				buf.push(null == __val__ ? "": __val__),
				buf.push("-->")
			}
			if (page.user_info) {
				buf.push("<div"),
				buf.push(attrs({
					id: "user_info",
					"class": "pin wfc"
				})),
				buf.push(">");
				var __val__ = emerge("_people_profile", {
					user_info: page.user_info,
					user: req.user
				});
				buf.push(null == __val__ ? "": __val__),
				buf.push("</div>")
			}
			if (page.pins) for (var $index = 0,
			$$l = page.pins.length; $index < $$l; $index++) {
				var pin = page.pins[$index],
				__val__ = emerge("_pin_item", {
					user: pin.user,
					pin: pin,
					board: pin.board
				});
				buf.push(null == __val__ ? "": __val__)
			} else for (var $index = 0,
			$$l = page.boards.length; $index < $$l; $index++) {
				var board = page.boards[$index],
				__val__ = emerge("_board_item", {
					board: board,
					user: req.user
				});
				buf.push(null == __val__ ? "": __val__)
			}
			buf.push("</div></div><script>(function(){app.initLikeButtons(),app.initAddCommentButtons(),app.initFollowButtons()})()</script>"),
			(~page.filter.indexOf(":kids") || ~page.filter.indexOf(":home")) && buf.push("<script>(function(){app.promotion&&app.promotion()})()</script>")
		}
		return buf.join("")
	},
	__t._nav_bar = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				id: "nav_bar"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "wrapper"
			})),
			buf.push("><ul"),
			buf.push(attrs({
				id: "nav",
				"class": "menu"
			})),
			buf.push("><li"),
			buf.push(attrs({
				"class": "client"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/apps/",
				title: "\u82b1\u74e3\u79fb\u52a8\u5ba2\u6237\u7aef"
			})),
			buf.push(">\u82b1\u74e3\u79fb\u52a8\u5ba2\u6237\u7aef</a></li>");
			var __val__ = emerge("_pointy_tip", {
				id: "client_tip",
				title: "\u82b1\u74e3\u79fb\u52a8\u5ba2\u6237\u7aef\u53d1\u5e03\u5566\uff01",
				content: null,
				className: "right-pointy"
			});
			buf.push(null == __val__ ? "": __val__);
			var filter = page.filter.split(":"),
			cur = "boards-popular",
			items = [["following", "\u4f60\u5173\u6ce8\u7684\u91c7\u96c6"], ["popular", "\u70ed\u95e8\u91c7\u96c6"], ["boards-popular", "\u70ed\u95e8\u753b\u677f"], ["all", "\u6700\u8fd1\u91c7\u96c6"]];
			filter[0] === "pin" && (cur = filter[1] === "category" ? "all": filter[1]),
			req.user || items.shift();
			for (var i = 0,
			l = items.length; i < l; i++) {
				var x = items[i],
				cls = "nav " + x[0];
				cur == x[0] && (cls += " selected"),
				buf.push("<li><a"),
				buf.push(attrs({
					href: "/" + x[0].replace("-", "/") + "/",
					"class": cls
				})),
				buf.push("><span>");
				var __val__ = x[1];
				buf.push(null == __val__ ? "": __val__),
				buf.push("</span><em></em></a></li>")
			}
			buf.push('</ul></div></div><script>(function(){window.addEvent("domready",function(){var a=document.id("client_tip");if(a&&!Cookie.read("_hbm_a")&&!Browser.ie){var a=new PointyTip("client_tip",{});a.reset({position:{top:55,right:0},arrow:{right:document.id("invite_friends")?170:60}}),$$("#nav_bar li.client a").addEvents({mouseover:function(){a.element.show(),Cookie.write("_hbm_a",1,{duration:30})},mouseout:function(){a.element.hide()}})}});var a=document.id("invites_tip");if(a){var a=new PointyTip("invites_tip",{});a.reset({position:{top:41,right:0},arrow:{right:60}}),a.addEvents({close:function(){(new Request.JSON({url:"/profile/status/update/",data:{type:"invite"},onSuccess:function(){}})).post()}});var b=document.id("tip_weibo_btn");b&&(b=new Button("tip_weibo_btn",{click:function(){var b=$("tip_weibo_text").get("value");if(b.trim()=="")return errorMsg("weibo_text","\u8bf7\u8f93\u5165\u5fae\u535a\u5185\u5bb9");var c=this.disable();(new Request.JSON({url:"/invites/update_weibo_status/",data:{text:b},onSuccess:function(){c.setTitle("\u53d1\u9001\u5b8c\u6210"),a.fireEvent("close")}})).post()}}))}})()</script>')
		}
		return buf.join("")
	},
	__t._people_boards = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_header");
			buf.push(null == __val__ ? "": __val__);
			var __val__ = emerge("_people_layout", {
				req: req,
				user: page.user,
				ctx: "boards",
				body_tpl: "_people_boards_body"
			});
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._people_boards_body = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				id: "waterfall"
			})),
			buf.push("><ul"),
			buf.push(attrs({
				"class": "sortable"
			})),
			buf.push(">");
			var boards = user.boards;
			delete user.boards;
			for (var $index = 0,
			$$l = boards.length; $index < $$l; $index++) {
				var b = boards[$index];
				b.user = user,
				buf.push("<li>");
				var __val__ = emerge("_board_item", {
					board: b,
					user: this.req.user
				});
				buf.push(null == __val__ ? "": __val__),
				buf.push("</li>")
			}
			buf.push("</ul></div>")
		}
		return buf.join("")
	},
	__t._people_layout = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, user_url = "/" + user.urlname;
			buf.push("<div"),
			buf.push(attrs({
				id: "wrapper",
				"class": "wrapper bl"
			})),
			buf.push("><div"),
			buf.push(attrs({
				id: "ProfileSidebar"
			})),
			buf.push("><h1>" + escape((interp = user.username) == null ? "": interp) + "</h1>");
			if (req.user && req.user.user_id == 1 || user.user_id != 1) buf.push("<p><a"),
			buf.push(attrs({
				href: "" + user_url + "/followers/"
			})),
			buf.push("><span>" + escape((interp = user.follower_count) == null ? "": interp) + "</span>\u4e2a\u7c89\u4e1d</a>,&nbsp; <a"),
			buf.push(attrs({
				href: "" + user_url + "/following/"
			})),
			buf.push(">\u5173\u6ce8<span>" + escape((interp = user.following_count) == null ? "": interp) + "</span>\u4eba</a></p>");
			buf.push("<div"),
			buf.push(attrs({
				id: "ProfileImage"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/" + escape(user.urlname) + "/",
				title: escape(user.username),
				"class": "img x"
			})),
			buf.push("><img"),
			buf.push(attrs({
				src: avatar(user, "fw192")
			})),
			buf.push("/></a>"),
			req.user && user.user_id === req.user.user_id ? (buf.push("<a"), buf.push(attrs({
				href: "/settings/",
				"class": "btn btn13 wbtn"
			})), buf.push("><strong> \u8d26\u53f7\u8bbe\u7f6e</strong><span></span></a>")) : user.following ? (buf.push("<a"), buf.push(attrs({
				"data-id": "" + user.urlname + "",
				href: "#",
				onclick: "return false;",
				"class": "unfollowuser btn wbtn"
			})), buf.push("><strong> \u53d6\u6d88\u5173\u6ce8</strong><span></span></a>")) : (buf.push("<a"), buf.push(attrs({
				"data-id": "" + user.urlname + "",
				href: "#",
				onclick: "return false;",
				"class": "followuser btn rbtn"
			})), buf.push("><strong> \u5173\u6ce8</strong><span></span></a>")),
			buf.push("</div><p"),
			buf.push(attrs({
				"class": "muted"
			})),
			buf.push(">" + escape((interp = user.profile.about) == null ? "": interp) + "</p><p"),
			buf.push(attrs({
				"class": "less"
			})),
			buf.push(">" + escape((interp = user.profile.location) == null ? "": interp) + "</p><ul"),
			buf.push(attrs({
				id: "ProfileLinks"
			})),
			buf.push(">"),
			user.profile.url && (buf.push("<li"), buf.push(attrs({
				id: "ProfileLinksWebsite"
			})), buf.push("><a"), buf.push(attrs({
				href: "" + (user.profile.url.substr(0, 7) == "http://" ? user.profile.url: "http://" + user.profile.url) + "",
				title: "\u8bbf\u95ee" + user.username + "\u7684\u4e2a\u4eba\u4e3b\u9875",
				target: "_blank",
				"class": "btn wbtn"
			})), buf.push("><strong><img"), buf.push(attrs({
				src: "/img/ProfileIconWebsite.png",
				alt: "\u8bbf\u95ee\u4e2a\u4eba\u4e3b\u9875",
				style: "margin-top: 3px;"
			})), buf.push("/></strong><span></span></a></li>"));
			if (user.bindings.weibo && !user.status.hide_weibo) {
				var weibo = user.bindings.weibo.user_info;
				buf.push("<li"),
				buf.push(attrs({
					id: "ProfileLinksWeibo"
				})),
				buf.push("><a"),
				buf.push(attrs({
					href: "http://weibo.com/" + (weibo.urlname ? weibo.urlname: weibo.id) + "",
					title: "\u8bbf\u95ee" + user.username + "\u7684\u5fae\u535a",
					target: "_blank",
					"class": "btn wbtn"
				})),
				buf.push("><strong><img"),
				buf.push(attrs({
					src: "/img/ProfileIconWeibo.png",
					alt: "\u8bbf\u95ee\u5fae\u535a"
				})),
				buf.push("/></strong><span></span></a></li>")
			}
			user.bindings.douban && !user.status.hide_douban && (buf.push("<li"), buf.push(attrs({
				id: "ProfileLinksDouban"
			})), buf.push("><a"), buf.push(attrs({
				href: "http://www.douban.com/people/" + user.bindings.douban.user_info.urlname + "/",
				title: "\u8bbf\u95ee" + user.username + "\u7684\u8c46\u74e3\u4e3b\u9875",
				target: "_blank",
				"class": "btn wbtn"
			})), buf.push("><strong><img"), buf.push(attrs({
				src: "/img/ProfileIconDouban.png",
				alt: "\u8bbf\u95ee\u8c46\u74e3\u4e3b\u9875"
			})), buf.push("/></strong><span></span></a></li>")),
			user.bindings.renren && !user.status.hide_renren && (buf.push("<li"), buf.push(attrs({
				id: "ProfileLinksRenren"
			})), buf.push("><a"), buf.push(attrs({
				href: "http://www.renren.com/profile.do?id=" + user.bindings.renren.user_info.id + "",
				title: "\u8bbf\u95ee" + user.username + "\u7684\u4eba\u4eba\u4e3b\u9875",
				target: "_blank",
				"class": "btn wbtn"
			})), buf.push("><strong><img"), buf.push(attrs({
				src: "/img/ProfileIconRenren.png",
				alt: "\u8bbf\u95ee\u4eba\u4eba\u4e3b\u9875"
			})), buf.push("/></strong><span></span></a></li>")),
			user.bindings.tqq && !user.status.hide_tqq && (buf.push("<li"), buf.push(attrs({
				id: "ProfileLinksTqq"
			})), buf.push("><a"), buf.push(attrs({
				href: "http://t.qq.com/" + user.bindings.tqq.user_info.urlname + "",
				title: "\u8bbf\u95ee" + user.username + "\u7684\u817e\u8baf\u5fae\u535a\u4e3b\u9875",
				target: "_blank",
				"class": "btn wbtn"
			})), buf.push("><strong><img"), buf.push(attrs({
				src: "/img/ProfileIconTqq.png",
				alt: "\u8bbf\u95ee\u817e\u8baf\u5fae\u535a\u4e3b\u9875"
			})), buf.push("/></strong><span></span></a></li>")),
			buf.push("</ul>");
			if (user.feeds) {
				var __val__ = emerge("_feed_list", {
					feeds: user.feeds,
					user: user
				});
				buf.push(null == __val__ ? "": __val__)
			}
			buf.push("</div><div"),
			buf.push(attrs({
				id: "ctx_bar"
			})),
			buf.push("><p"),
			buf.push(attrs({
				"class": "bar-links"
			})),
			buf.push(">");
			var b = [],
			m = [[user.board_count, "boards", "\u753b\u677f", "/"], [user.pin_count, "pins", "\u91c7\u96c6", "/pins/"], [user.like_count, "likes", "\u559c\u6b22", "/likes/"]];
			for (var i = 0,
			$$l = m.length; i < $$l; i++) {
				var x = m[i];
				if (ctx == x[1]) {
					buf.push("<span"),
					buf.push(attrs({
						"class": "selected"
					})),
					buf.push(">");
					var __val__ = x[0] + " " + x[2];
					buf.push(null == __val__ ? "": __val__),
					buf.push("</span>")
				} else {
					buf.push("<a"),
					buf.push(attrs({
						href: "/" + user.urlname + "" + x[3]
					})),
					buf.push(">");
					var __val__ = x[0] + " " + x[2];
					buf.push(null == __val__ ? "": __val__),
					buf.push("</a>")
				}
				i !== m.length - 1 && buf.push("&nbsp;\u00b7&nbsp;")
			}
			buf.push("</p>"),
			ctx == "boards" && req.user && req.user.user_id == user.user_id && (buf.push("<div"), buf.push(attrs({
				id: "BoardButton"
			})), buf.push("><a"), buf.push(attrs({
				id: "boards_sort_cancel",
				style: "visibility:hidden;",
				href: "#",
				onclick: "return false;",
				"class": "btn wbtn"
			})), buf.push("><strong> \u53d6\u6d88</strong><span></span></a><a"), buf.push(attrs({
				id: "boards_sort",
				href: "#",
				onclick: "return false;",
				"class": "btn wbtn"
			})), buf.push("><strong> \u753b\u677f\u6392\u5e8f</strong><span></span></a></div>")),
			buf.push("</div>");
			var __val__ = emerge(body_tpl, {
				user: user
			});
			buf.push(null == __val__ ? "": __val__),
			buf.push("<div"),
			buf.push(attrs({
				"class": "clear"
			})),
			buf.push('></div></div><script>(function(){app.initFollowButtons(),app.initFollowUserButtons(function(a){function b(a,b){b?(new Button(a.addClass("unfollow"))).setTitle("\u53d6\u6d88\u5173\u6ce8"):(new Button(a.removeClass("unfollow"))).setTitle("\u5173\u6ce8")}$$("a.follow,a.unfollow").each(function(c){b(c,a.hasClass("unfollowuser"))})}),app.initLikeButtons(),app.initAddCommentButtons();var a=document.id("boards_sort");if(a){var b=!1,c=$$(".sortable")[0],d,e,f,g=new SmoothNotification({relative:{to:$("ctx_bar"),position:"center",edge:"center"},styles:{"border-radius":"5px"},duration:4e3}),h=function(){b=!0,a.setTitle("\u4fdd\u5b58\u6392\u5e8f"),a.element.removeClass("wbtn").addClass("rbtn"),c.addClass("dragable");if(!d){var h,i;d=new Sortables(c,{clone:!0,onStart:function(a,b){a.setStyles({border:"dashed 3px #DDD","margin-left":"14px","margin-bottom":"14px",width:b.getStyle("width").toInt()-5,height:b.getStyle("height").toInt()-5}),a.getChildren().setStyles({visibility:"hidden"}),b.setStyles({"z-index":999999,opacity:.6,filter:"alpha(opacity=40)"})},onComplete:function(a){a.getChildren().setStyles({visibility:""}),a.set("style","")}})}f=d.serialize(0,function(a){return a.getElement("div.Board").get("data-id")}),d.attach(),e=document.id("boards_sort_cancel"),e.setStyle("visibility","visible").show(),g.show("\u63d0\u793a\uff1a\u62d6\u52a8\u753b\u677f\u6765\u6539\u53d8\u6392\u5e8f"),e.onclick=function(){var a=d.serialize(0,function(a){return a.getElement("div.Board").get("data-id")});if(f.join("-")!=a.join("-")){var b=c.getChildren("li");b.dispose();for(var e=0;f[e];e++)for(var g=0;b[g];g++)if(b[g].getChildren(".Board").get("data-id")==f[e]){b[g].inject(c);break}j()}else j()}},i=function(){var b=d.serialize(0,function(a){return a.getElement("div.Board").get("data-id")});f.join("-")!=b.join("-")?(a.disable(),(new Request.JSON({url:"/boards/sort/",data:{ids:b.join(",")},onSuccess:j(!0)})).post()):j(!0)},j=function(f){c.removeClass("dragable"),a.setTitle("\u753b\u677f\u6392\u5e8f"),a.element.removeClass("rbtn").addClass("wbtn"),a.enable(),b=!1,e.hide(),b=!1,d.detach();if(f){g&&g.hide();var h=$("ctx_bar").getSize(),f=new SmoothNotification({duration:2e3,relative:{to:$("ctx_bar"),position:"upperLeft",edge:"upperLeft"},styles:{padding:0,width:h.x,height:h.y,"line-height":h.y},style:"yellow"});f.show("\u6392\u5e8f\u5df2\u4fdd\u5b58")}};a=new Button(a,{disabledTitle:"\u6b63\u5728\u4fdd\u5b58",click:function(){b?i():h()}})}})()</script>')
		}
		return buf.join("")
	},
	__t._people_likes = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_header");
			buf.push(null == __val__ ? "": __val__);
			var __val__ = emerge("_people_layout", {
				req: req,
				user: page.user,
				ctx: "likes",
				body_tpl: "_people_likes_body"
			});
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._people_likes_body = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				id: "waterfall"
			})),
			buf.push(">");
			for (var pins = user.likes,
			i = 0,
			l = pins.length; i < l; i++) {
				var pin = pins[i],
				__val__ = emerge("_pin_item", {
					user: pin.user,
					pin: pin,
					board: pin.board
				});
				buf.push(null == __val__ ? "": __val__)
			}
			buf.push("</div>")
		}
		return buf.join("")
	},
	__t._people_pins = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, __val__ = emerge("_header");
			buf.push(null == __val__ ? "": __val__);
			var __val__ = emerge("_people_layout", {
				req: req,
				user: page.user,
				ctx: "pins",
				body_tpl: "_people_pins_body"
			});
			buf.push(null == __val__ ? "": __val__)
		}
		return buf.join("")
	},
	__t._people_pins_body = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				id: "waterfall"
			})),
			buf.push(">");
			for (var $index = 0,
			$$l = user.pins.length; $index < $$l; $index++) {
				var pin = user.pins[$index],
				__val__ = emerge("_pin_item", {
					user: user,
					pin: pin,
					board: pin.board
				});
				buf.push(null == __val__ ? "": __val__)
			}
			buf.push("</div>")
		}
		return buf.join("")
	},
	__t._pin_item = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp;
			buf.push("<div"),
			buf.push(attrs({
				"data-id": "" + pin.pin_id + "",
				"data-seq": pin.seq ? pin.seq: pin.pin_id,
				"class": "pin wfc"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "hidden"
			})),
			buf.push("><a"),
			buf.push(attrs({
				href: "/" + user.urlname + "/"
			})),
			buf.push(">" + escape((interp = user.username) == null ? "": interp) + "</a>\u91c7\u96c6\u5230<a"),
			buf.push(attrs({
				href: "/boards/" + pin.board_id + ""
			})),
			buf.push(">" + escape((interp = board.title) == null ? "": interp) + "</a></div><div"),
			buf.push(attrs({
				"class": "actions"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "right"
			})),
			buf.push(">"),
			this.req.user && pin.user_id === this.req.user.user_id ? (buf.push("<a"), buf.push(attrs({
				href: "/pins/" + pin.pin_id + "/edit/",
				"class": "edit btn btn11 wbtn"
			})), buf.push("><strong>\u7f16\u8f91</strong><span></span></a>")) : pin.liked ? (buf.push("<a"), buf.push(attrs({
				"data-id": "" + pin.pin_id + "",
				href: "#",
				onclick: "return false;",
				"class": "unlike btn btn11 wbtn"
			})), buf.push("><strong><em></em>\u53d6\u6d88\u559c\u6b22</strong><span></span></a>")) : (buf.push("<a"), buf.push(attrs({
				"data-id": "" + pin.pin_id + "",
				href: "#",
				onclick: "return false;",
				"class": "like btn btn11 wbtn"
			})), buf.push("><strong><em></em>\u559c\u6b22</strong><span></span></a>")),
			pin.comments && this.req.user ? (buf.push("<a"), buf.push(attrs({
				href: "#",
				onclick: "return false;",
				"class": "comment clickable disabled btn btn11 wbtn"
			})), buf.push("><strong><em></em>\u8bc4\u8bba</strong><span></span></a>")) : (buf.push("<a"), buf.push(attrs({
				href: "#",
				onclick: "return false;",
				"class": "comment clickable btn btn11 wbtn"
			})), buf.push("><strong><em></em>\u8bc4\u8bba</strong><span></span></a>")),
			buf.push("</div>"),
			pin.private || (buf.push("<div"), buf.push(attrs({
				"class": "left"
			})), buf.push("><a"), buf.push(attrs({
				onclick: "if (app.forceLogin()) app.showDialog('repin', '" + pin.pin_id + "'); return false",
				href: "#",
				"class": "repin btn btn11 wbtn"
			})), buf.push("><strong><em></em>\u8f6c\u91c7</strong><span></span></a></div>")),
			buf.push("</div>");
			var size = imgSize(pin.file, "fw192"),
			way = "";
			pin.via === 2 ? way = "\u901a\u8fc7\u4e66\u7b7e\u680f\u5de5\u5177": pin.via === 3 ? way = "\u901a\u8fc7\u5206\u4eab\u6309\u94ae": pin.via === 4 ? way = "\u901a\u8fc7bShare\u6309\u94ae": pin.via === 5 ? way = "\u901a\u8fc7JiaThis\u6309\u94ae": pin.via === 6 ? way = "\u901a\u8fc7\u82b1\u74e3\u624b\u673a\u5ba2\u6237\u7aef": pin.via === 7 && (way = "\u901a\u8fc7\u82b1\u74e3Chrome\u6269\u5c55"),
			buf.push("<a"),
			buf.push(attrs({
				href: "/pins/" + pin.pin_id + "/",
				"class": "img " + (size.h > 800 ? "long": "") + " " + "x"
			})),
			buf.push(">");
			var __val__ = img(pin.file, "fw192", {
				alt: user.username + way + "\u91c7\u96c6\u5230" + board.title
			});
			buf.push(null == __val__ ? "": __val__),
			pin.media_type === 1 && (buf.push("<img"), buf.push(attrs({
				src: "/img/media_video.png",
				"class": "video-icon"
			})), buf.push("/>")),
			size.h > 800 && (buf.push("<span"), buf.push(attrs({
				"class": "stop"
			})), buf.push("></span>")),
			buf.push("</a><p"),
			buf.push(attrs({
				"class": "description"
			})),
			buf.push(">");
			var __val__ = pin.raw_text.format_text(pin.metas);
			buf.push(null == __val__ ? "": __val__),
			buf.push("</p><p"),
			buf.push(attrs({
				"class": "stats less"
			})),
			buf.push(">");
			if (pin.like_count) {
				buf.push("<span"),
				buf.push(attrs({
					"class": "LikesCount"
				})),
				buf.push(">");
				var __val__ = pin.like_count + " \u559c\u6b22&nbsp;&nbsp;";
				buf.push(null == __val__ ? "": __val__),
				buf.push("</span>")
			}
			if (pin.comment_count) {
				buf.push("<span"),
				buf.push(attrs({
					"class": "CommentsCount"
				})),
				buf.push(">");
				var __val__ = pin.comment_count + " \u8bc4\u8bba&nbsp;&nbsp;";
				buf.push(null == __val__ ? "": __val__),
				buf.push("</span>")
			}
			if (pin.repin_count) {
				buf.push("<span"),
				buf.push(attrs({
					"class": "RepinsCount"
				})),
				buf.push(">");
				var __val__ = pin.repin_count + " \u8f6c\u91c7&nbsp;&nbsp;";
				buf.push(null == __val__ ? "": __val__),
				buf.push("</span>")
			}
			buf.push("</p><div"),
			buf.push(attrs({
				"class": "convo attribution clearfix"
			})),
			buf.push(">"),
			this.page.show_pin_source ? (buf.push("<p"), buf.push(attrs({
				"class": "NoImage"
			})), buf.push("><a"), buf.push(attrs({
				href: "" + pin.link + "",
				target: "_blank"
			})), buf.push(">" + escape((interp = pin.source) == null ? "": interp) + "</a></p>")) : (buf.push("<p><a"), buf.push(attrs({
				href: "/" + escape(user.urlname) + "/",
				title: escape(user.username),
				"class": "img x"
			})), buf.push("><img"), buf.push(attrs({
				src: avatar(user, undefined)
			})), buf.push("/></a><a"), buf.push(attrs({
				href: "/" + user.urlname + "/",
				"class": "author x"
			})), buf.push(">" + escape((interp = user.username) == null ? "": interp) + "</a>"), pin.via_user && (buf.push("&nbsp;\u901a\u8fc7&nbsp;<a"), buf.push(attrs({
				href: "/" + pin.via_user.urlname + "/",
				"class": "x"
			})), buf.push(">" + escape((interp = pin.via_user.username) == null ? "": interp) + "</a>")), buf.push("&nbsp;\u91c7\u96c6\u5230&nbsp;<a"), buf.push(attrs({
				href: "/boards/" + pin.board_id + "/",
				"class": "x"
			})), buf.push(">" + escape((interp = pin.board.title) == null ? "": interp) + "</a></p><a"), buf.push(attrs({
				title: "\u56de\u590d",
				"class": "replyButton"
			})), buf.push("></a>")),
			buf.push("</div><div"),
			buf.push(attrs({
				style: pin.comments ? "": "display:none;",
				"class": "comments muted"
			})),
			buf.push(">");
			if (pin.comments) for (var $index = 0,
			$$l = pin.comments.length; $index < $$l; $index++) {
				var comment = pin.comments[$index],
				__val__ = emerge("_comment_item_convo", comment);
				buf.push(null == __val__ ? "": __val__)
			}
			buf.push("</div>");
			if (this.req.user) {
				var au = this.req.user;
				buf.push("<div"),
				buf.push(attrs({
					style: "display: " + (pin.comments ? "block": "none") + ";",
					"class": "write convo clearfix"
				})),
				buf.push("><a"),
				buf.push(attrs({
					href: "/" + escape(au.urlname) + "/",
					title: escape(au.username),
					"class": "img x"
				})),
				buf.push("><img"),
				buf.push(attrs({
					src: avatar(au, undefined)
				})),
				buf.push("/></a><form"),
				buf.push(attrs({
					action: "/pins/" + pin.pin_id + "/comments/",
					method: "POST"
				})),
				buf.push("><textarea"),
				buf.push(attrs({
					placeholder: "\u6dfb\u52a0\u8bc4\u8bba...",
					"class": "GridComment"
				})),
				buf.push("></textarea><a"),
				buf.push(attrs({
					href: "#",
					onclick: "return false;",
					"class": "grid_comment_button"
				})),
				buf.push("></a></form></div>")
			}
			buf.push("</div>")
		}
		return buf.join("")
	},
	__t._pin_success = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, pin = app.$pin,
			boards = app.req.user.boards,
			board;
			for (var i = 0,
			l = boards.length; i < l; i++) if (boards[i].board_id == pin.board_id) {
				board = boards[i];
				break
			}
			buf.push("<div"),
			buf.push(attrs({
				"class": "form"
			})),
			buf.push("><div"),
			buf.push(attrs({
				"class": "pin-done"
			})),
			buf.push("><h3>\u4f60\u5df2\u7ecf\u6210\u529f\u91c7\u96c6\u5230\u753b\u677f<a"),
			buf.push(attrs({
				href: "/boards/" + board.board_id + "/",
				target: "_blank",
				"class": "less"
			})),
			buf.push(">" + escape((interp = board.title) == null ? "": interp) + "</a></h3><div"),
			buf.push(attrs({
				id: "pin_operations"
			})),
			buf.push("><a"),
			buf.push(attrs({
				id: "view_pin",
				href: "/pins/" + pin.pin_id + "/"
			})),
			buf.push(">\u67e5\u770b\u8fd9\u4e2a\u91c7\u96c6</a><a"),
			buf.push(attrs({
				id: "close_window",
				href: "#"
			})),
			buf.push(">\u5173\u95ed\u7a97\u53e3</a></div><ul><li><a"),
			buf.push(attrs({
				id: "share_sinaweibo",
				href: "#",
				onclick: "return false;",
				"class": "share-button btn btn18 wbtn"
			})),
			buf.push("><strong>\u5206\u4eab\u5230\u65b0\u6d6a\u5fae\u535a</strong><span></span></a></li><li><a"),
			buf.push(attrs({
				id: "share_douban",
				href: "#",
				onclick: "return false;",
				"class": "share-button btn btn18 wbtn"
			})),
			buf.push("><strong>\u5206\u4eab\u5230\u8c46\u74e3</strong><span></span></a></li><li><a"),
			buf.push(attrs({
				id: "share_qzone",
				href: "#",
				onclick: "return false;",
				"class": "share-button btn btn18 wbtn"
			})),
			buf.push('><strong>\u5206\u4eab\u5230QQ\u7a7a\u95f4</strong><span></span></a></li></ul></div></div><script>(function(){var a=app.$pin,b="http://"+app.host+"/pins/"+a.pin_id+"/",c=app.imgURL(a.file,"fw554"),d=a.raw_text,e=$("PinSuccess"),f=window.close;d==""&&(d="\u521a\u521a\u5206\u4eab\u81ea\u82b1\u74e3\u7f51\u7684\u56fe\u7247\uff0c\u6765\u770b\u770b\u5427 "),e&&(f=function(){app.hideDialog()}),$("close_window").addEvent("click",function(){return f(),!1}),Cookie.read("share_to_weibo")=="true"&&$("share_sinaweibo").addClass("disabled"),Cookie.read("share_to_douban")=="true"&&$("share_douban").addClass("disabled"),$$(".share-button").addEvent("click",function(){if(this.hasClass("disabled"))return;var a=["url="+encodeURIComponent(b)];if(this.id=="share_sinaweibo"){var e="http://v.t.sina.com.cn/share/share.php?";a.push("&appkey=2499394483"),a.push("&pic="+encodeURIComponent(c)),a.push("&ralateUid=2493118952"),a.push("&title="+encodeURIComponent(d))}else if(this.id=="share_douban"){var e="http://www.douban.com/recommend/?";a.push("&title="+encodeURIComponent(d)),a.push("&comment="+encodeURIComponent(d))}else if(this.id=="share_qzone"){var e="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?";a.push("&title="+encodeURIComponent(d)),a.push("&pics="+encodeURIComponent(c))}a=a.join(""),function(b,c,d){function g(){window.open([e,a].join(""),"mb",["toolbar=0,status=0,resizable=1,width=620,height=450,left=",(b.width-620)/2,",top=",(b.height-450)/2].join(""))||(u.href=[e,a].join("")),f()}/Firefox/.test(navigator.userAgent)?setTimeout(g,0):g()}(screen,document,encodeURIComponent)}),e||($("view_pin").set("target","_blank").addEvent("click",function(){setTimeout(f,100)}),setTimeout(function(){f()},3e3))})()</script><script>(function(){var a=$("PinSuccess"),b=app.$pin;if(!a&&b.is_share_btn)try{var c=b.link,d="",e=(new RegExp("^https?://([^/]+)(?:/.*)?")).exec(c);e&&e.length==2&&(d=e[1]),_gaq.push(["_trackEvent","SharePinSuccess",d,app.page.params.url])}catch(f){}})()</script>')
		}
		return buf.join("")
	},
	__t._pin_view = function(locals) {
		var buf = [];
		with(locals || {}) {
			var interp, pin = page.pin,
			board = pin.board,
			board_url = "/boards/" + board.board_id,
			pin_url = "/pins/" + pin.pin_id,
			user_url = "/" + pin.user.urlname + "/",
			is_owner = this.req.user && pin.user_id === this.req.user.user_id,
			via_user = pin.via_user,
			via = pin.via_pin,
			pin_link_host = pin.source || "";
			if (!pin_link_host) {
				var match = /^http(?:s)?:\/\/([^/] + )( ? :\ / . * ) ? /.exec(pin.link);match&&match.length==2&&(pin_link_host=match[1]||"")}var repin_board_pins_mixin=function(a){for(var b=0,c=a.length;b<c;b++){var d=a[b];buf.push("<a"),buf.push(attrs({href:"/pins / "+d.pin_id+" / ","class ":"img "})),buf.push(" > <img "),buf.push(attrs({width:"50 ",height:"50 ",alt:"Pin Thumbnail ",src:imgURL(d.file,"sq75 ")})),buf.push(" / ></a>")}if(a.length<3)for(var e=0;e<3-a.length;e++)buf.push("<img"),buf.push(attrs({src:"/img / default_pin_bg.gif ",width:"50 ",height:"50 ",alt:"Pin Thumbnail "})),buf.push(" / >")},__val__=emerge("_header ");buf.push(null==__val__?"":__val__),buf.push(" < div "),buf.push(attrs({"class ":"wfx "})),buf.push(" > <div "),buf.push(attrs({"class ":"CloseupLeft "})),buf.push(" > ");var __val__=emerge("_board_item ",{board:board,user:this.req.user,pin:pin});buf.push(null==__val__?"":__val__);if(pin.siblings){buf.push(" < div "),buf.push(attrs({"class ":"Board DomainPins clearfix "})),buf.push(" > <h3 > \u540c\u91c7\u81ea < a "),buf.push(attrs({href:" / from / "+pin.source+" / ","class ":"less x "})),buf.push(" > "+escape((interp=pin.source)==null?"":interp)+" < /a></h3 > <a "),buf.push(attrs({href:" / from / "+pin.source+" / ","class ":"link x "})),buf.push(" > ");for(var $index=0,$$l=pin.siblings.length;$index<$$l;$index++){var sp=pin.siblings[$index];buf.push(" < img "),buf.push(attrs({width:"75 ",height:"75 ",src:imgURL(sp.file,"sq75 ")})),buf.push(" / >")}buf.push(" < /a></div > ")}buf.push(" < /div><div"),buf.push(attrs({"class":"CloseupRight"})),buf.push("><div"),buf.push(attrs({"class":"wt clearfix"})),buf.push("><div"),buf.push(attrs({id:"PinPinner"})),buf.push("><a"),buf.push(attrs({id:"PinnerImage",href:""+user_url+"","class":"img"})),buf.push("><img"),buf.push(attrs({src:avatar(pin.user,undefined)})),buf.push("/ > </a>");if(via_user){buf.push("<p"),buf.push(attrs({id:"PinnerName"})),buf.push("><a"),buf.push(attrs({href:""+user_url+""})),buf.push(">"+escape((interp=pin.user.username)==null?"":interp)+"</a > <span "),buf.push(attrs({"class ":"less "})),buf.push(" > &nbsp;\u4ece & nbsp; < /span><a"),buf.push(attrs({href:"/"+via_user.urlname+" / "})),buf.push(" > "+escape((interp=via_user.username)==null?"":interp)+" < /a></p > <p "),buf.push(attrs({id:"PinnerStats ","class ":"less "})),buf.push(" > \u8f6c\u91c7\u4e8e & nbsp; < span "),buf.push(attrs({"data - ts ":""+pin.created_at+"","class ":"ts - words "})),buf.push(" > ");var __val__=Date.timeAgo(pin.created_at);buf.push(null==__val__?"":__val__),buf.push(" < /span></p > ")}else{buf.push(" < p "),buf.push(attrs({id:"PinnerName "})),buf.push(" > <a "),buf.push(attrs({href:""+user_url+""})),buf.push(" > "+escape((interp=pin.user.username)==null?"":interp)+" < /a></p > <p "),buf.push(attrs({id:"PinnerStats ","class ":"less "})),buf.push(" > "),pin.via===2?(buf.push("\u901a\u8fc7 < a "),buf.push(attrs({href:"http: //huaban.com/about/goodies/?ref=pins",target:"_blank"})),buf.push(">\u4e66\u7b7e\u680f\u5de5\u5177</a>")):pin.via===3?buf.push("\u901a\u8fc7\u5206\u4eab\u6309\u94ae"):pin.via===4?(buf.push("\u901a\u8fc7<a"),buf.push(attrs({href:"http://www.bshare.cn/",target:"_blank",rel:"nofollow"})),buf.push(">bShare\u6309\u94ae</a>")):pin.via===5?(buf.push("\u901a\u8fc7<a"),buf.push(attrs({href:"http://www.jiathis.com/",target:"_blank",rel:"nofollow"})),buf.push(">JiaThis\u6309\u94ae</a>")):pin.via===6?buf.push("\u901a\u8fc7\u82b1\u74e3\u624b\u673a\u5ba2\u6237\u7aef"):pin.via===7&&(buf.push("\u901a\u8fc7<a"),buf.push(attrs({href:"http://huaban.com/about/goodies/chrome/?ref=pins",target:"_blank"})),buf.push(">\u82b1\u74e3Chrome\u6269\u5c55</a>")),buf.push("\u91c7\u96c6\u4e8e&nbsp;<span"),buf.push(attrs({"data-ts":""+pin.created_at+"","class":"ts-words"})),buf.push(">");var __val__=Date.timeAgo(pin.created_at);buf.push(null==__val__?"":__val__),buf.push("</span></p>")}buf.push("</div><div"),buf.push(attrs({id:"PinActionButtons"})),buf.push(">"),pin.source&&(buf.push("<p"),buf.push(attrs({id:"pin_source","class":"light"})),buf.push(">\u91c7\u81ea <a"),buf.push(attrs({href:""+pin.link+"",target:"_blank",rel:"nofollow",onclick:"try{_gaq.push(['_trackEvent', 'Pin Links', '"+pin_link_host+"', '"+pin.link+"']);}catch(e){}","class":"jd-link"})),buf.push(">"+escape((interp=pin.source)==null?"":interp)+"</a></p>")),buf.push("<ul>"),pin.board.is_private||(buf.push("<li"),buf.push(attrs({"class":"repin-button"})),buf.push("><a"),buf.push(attrs({onclick:"if (app.forceLogin()) app.showDialog('repin', '"+pin.pin_id+"'); return false",href:"#","class":"btn btn13 wbtn"})),buf.push("><strong><em></em>\u8f6c\u91c7</strong><span></span></a></li>")),is_owner?(buf.push("<li"),buf.push(attrs({"class":"edit-button"})),buf.push("><a"),buf.push(attrs({href:""+pin_url+"/edit/","class":"btn wbtn"})),buf.push("><strong>\u7f16\u8f91</strong><span></span></a></li>")):pin.liked?(buf.push("<li"),buf.push(attrs({"class":"like-button"})),buf.push("><a"),buf.push(attrs({"data-id":""+pin.pin_id+"",title:"\u53d6\u6d88\u559c\u6b22",href:"#",onclick:"return false;","class":"unlike btn wbtn"})),buf.push("><strong><em></em>\u53d6\u6d88\u559c\u6b22</strong><span></span></a></li>")):(buf.push("<li"),buf.push(attrs({"class":"like-button"})),buf.push("><a"),buf.push(attrs({"data-id":""+pin.pin_id+"",title:"\u559c\u6b22",href:"#",onclick:"return false;","class":"like btn wbtn"})),buf.push("><strong><em></em>\u559c\u6b22</strong><span></span></a></li>")),buf.push("</ul></div><div"),buf.push(attrs({id:"pin_img","data-id":""+pin.pin_id+"","data-media-type":""+pin.media_type+"","data-orig-source":""+pin.orig_source+"","class":"pin-img"})),buf.push(">"),pin.link?pin_link_host?(buf.push("<a"),buf.push(attrs({href:""+pin.link+"",target:"_blank",rel:"nofollow",onclick:"try{_gaq.push(['_trackEvent', 'Pin Links', '"+pin_link_host+"', '"+pin.link+"']);}catch(e){}","class":"jd-link"})),buf.push("><img"),buf.push(attrs({alt:""+pin.user.username+"\u91c7\u96c6\u5230"+board.title+"",src:imgURL(pin.file,"fw554")})),buf.push("/></a>")):(buf.push("<a"),buf.push(attrs({href:""+pin.link+"",target:"_blank",rel:"nofollow"})),buf.push("><img"),buf.push(attrs({alt:""+pin.user.username+"\u91c7\u96c6\u5230"+board.title+"",src:imgURL(pin.file,"fw554")})),buf.push("/></a>")):(buf.push("<img"),buf.push(attrs({alt:"\u91c7\u96c6\u56fe\u7247",src:imgURL(pin.file,"fw554")})),buf.push("/>")),buf.push("<a"),buf.push(attrs({id:"zoomr_show",title:"\u67e5\u770b\u539f\u56fe"})),buf.push("></a></div><div"),buf.push(attrs({id:"pin_caption","class":"pin-caption"})),buf.push("><p"),buf.push(attrs({"class":"text"})),buf.push(">");var __val__=pin.raw_text.format_text(pin.metas);buf.push(null==__val__?"":__val__),buf.push("</p><p"),buf.push(attrs({"class":"via less"})),buf.push(">"),via?(buf.push("\u8f6c\u91c7\u81ea&nbsp;<a"),buf.push(attrs({href:"/"+via_user.urlname+"/","class":"x"})),buf.push(">"+escape((interp=via_user.username)==null?"":interp)+"</a>&nbsp;\u7684&nbsp;<a"),buf.push(attrs({href:"/boards/"+via.board_id+"/","class":"x"})),buf.push(">"+escape((interp=via.board.title)==null?"":interp)+"</a>")):pin.via===2?(buf.push("&nbsp;\u901a\u8fc7<a"),buf.push(attrs({href:"http://huaban.com/about/goodies/?ref=pins",target:"_blank"})),buf.push(">\u4e66\u7b7e\u680f\u5de5\u5177</a>")):pin.via===3?buf.push("&nbsp;\u901a\u8fc7\u5206\u4eab\u6309\u94ae"):pin.via===4?(buf.push("&nbsp;\u901a\u8fc7<a"),buf.push(attrs({href:"http://www.bshare.cn/",target:"_blank",rel:"nofollow"})),buf.push(">bShare\u6309\u94ae</a>")):pin.via===5?(buf.push("&nbsp;\u901a\u8fc7<a"),buf.push(attrs({href:"http://www.jiathis.com/",target:"_blank",rel:"nofollow"})),buf.push(">JiaThis\u6309\u94ae</a>")):pin.via===6?buf.push("&nbsp;\u901a\u8fc7\u82b1\u74e3\u624b\u673a\u5ba2\u6237\u7aef"):pin.via===7&&(buf.push("&nbsp;\u901a\u8fc7<a"),buf.push(attrs({href:"http://huaban.com/about/goodies/chrome/?ref=pins",target:"_blank"})),buf.push(">\u82b1\u74e3Chrome\u6269\u5c55</a>")),buf.push("</p>");if(via&&pin.original!==pin.via&&pin.original_pin){var orig_pin=pin.original_pin;buf.push("<p"),buf.push(attrs({"class":"origin less"})),buf.push(">\u6700\u521d\u7531&nbsp;<a"),buf.push(attrs({href:"/"+orig_pin.user.urlname+"/","class":"x"})),buf.push(">"+escape((interp=orig_pin.user.username)==null?"":interp)+"</a>&nbsp;\u91c7\u96c6\u5230&nbsp;<a"),buf.push(attrs({href:"/boards/"+orig_pin.board_id+"/","class":"x"})),buf.push(">"+escape((interp=orig_pin.board.title)==null?"":interp)+"</a></p>")}buf.push("</div><div"),buf.push(attrs({id:"pin_comments"})),buf.push(">"),pin.comment_count>20&&(buf.push("<div"),buf.push(attrs({id:"more_comments","class":"comment clearfix"})),buf.push(">\u52a0\u8f7d\u8f83\u65e9\u7684\u8bc4\u8bba</div>"));if(pin.comments)for(var $index=0,$$l=pin.comments.length;$index<$$l;$index++){var comment=pin.comments[$index];comment.pin=pin;var __val__=emerge("_comment_item",comment);buf.push(null==__val__?"":__val__)}buf.push("</div>");if(this.req.user){var __val__=emerge("_comment_form",{pin:pin,user:this.req.user});buf.push(null==__val__?"":__val__)}else{var __val__=emerge("_comment_form2",{pin:pin,user:this.req.user});buf.push(null==__val__?"":__val__)}buf.push("<div"),buf.push(attrs({id:"pin_likes","class":(!pin.likes||pin.likes.length===0?"hidden":"")+" "+"PinActivity"+" "+"clearfix"})),buf.push("><h4>\u8fd9\u4e9b\u4eba\u559c\u6b22</h4>");var likes=pin.likes||[],l=pin.like_count-likes.length;for(var $index=0,$$l=likes.length;$index<$$l;$index++){var u=likes[$index];buf.push("<a"),buf.push(attrs({href:"/"+u.urlname+"/",title:""+u.username+"","class":"avatar x"})),buf.push("><img"),buf.push(attrs({src:avatar(u,undefined)})),buf.push("/></a>")}l>0&&(buf.push("<p"),buf.push(attrs({"class":"PinMoreActivity"})),buf.push(">"+escape((interp=l)==null?"":interp)+"\u66f4\u591a\u559c\u6b22\u7684\u4eba</p>")),buf.push("</div><div"),buf.push(attrs({id:"PinRepins","class":(!pin.repins||pin.repins.length===0?"hidden":"")+" "+"PinActivity"+" "+"clearfix"})),buf.push("><h4>\u88ab\u8fd9\u4e9b\u4eba\u8f6c\u91c7</h4>");var repins=pin.repins||[],l=pin.repins_count-repins.length;for(var $index=0,$$l=repins.length;$index<$$l;$index++){var p=repins[$index];buf.push("<div"),buf.push(attrs({"class":"PinRepinStory"})),buf.push("><a"),buf.push(attrs({href:"/"+p.user.urlname+"/","class":"avatar x"})),buf.push("><img"),buf.push(attrs({src:avatar(p.user,undefined)})),buf.push("/></a><div"),buf.push(attrs({"class":"repin-post-attr"})),buf.push("><a"),buf.push(attrs({href:"/"+p.user.urlname+"/","class":"x"})),buf.push(">"+escape((interp=p.user.username)==null?"":interp)+"</a>\u91c7\u96c6\u5230<a"),buf.push(attrs({href:"/boards/"+p.board_id+"/","class":"x"})),buf.push(">"+escape((interp=p.board.title)==null?"":interp)+"</a></div><div"),buf.push(attrs({"class":"repin-board"})),buf.push(">"),repin_board_pins_mixin(p.board.pins),buf.push("<a"),buf.push(attrs({href:"/boards/"+p.board_id+"/","class":"stats x"})),buf.push(">"+escape((interp=p.board.pin_count)==null?"":interp)+"<span>\u91c7\u96c6</span></a></div></div>")}l>0&&(buf.push("<p"),buf.push(attrs({"class":"PinMoreActivity"})),buf.push(">"+escape((interp=l)==null?"":interp)+"\u66f4\u591a\u8f6c\u91c7</p>")),buf.push("</div><div"),buf.push(attrs({id:"pin_toolbar"})),buf.push("><ul><li><div"),buf.push(attrs({"class":"PriorAndNext"})),buf.push(">");var prev_class=pin.next?"":"disabled",next_class=pin.prev?"":"disabled";pin.next?(buf.push("<a"),buf.push(attrs({href:"/pins/"+pin.next.pin_id+"/",title:"\u4e0a\u4e00\u5f20","class":"prev "+prev_class+""+" "+"x"+" "+"self"})),buf.push("></a>")):(buf.push("<a"),buf.push(attrs({id:"prev_disabled",title:"\u4e0a\u4e00\u5f20","class":"prev "+prev_class+""})),buf.push("></a>")),pin.prev?(buf.push("<a"),buf.push(attrs({href:"/pins/"+pin.prev.pin_id+"/",title:"\u4e0b\u4e00\u5f20","class":"next "+next_class+""+" "+"x"+" "+"self"})),buf.push("></a>")):(buf.push("<a"),buf.push(attrs({id:"next_disabled",title:"\u4e0b\u4e00\u5f20","class":"next "+next_class+""})),buf.push("></a>")),buf.push("</div></li><li"),buf.push(attrs({"class":"share-text"})),buf.push(">\u5206\u4eab\u5230</li><li"),buf.push(attrs({id:"weibo_competition"})),buf.push("><div"),buf.push(attrs({"class":"noti"})),buf.push("><a"),buf.push(attrs({href:"http://apps.weibo.com/share/",target:"_blank"})),buf.push(">\u5fae\u5206\u4eab\u5927\u8d5bing</a><!--a.close(title=\"\u5173\u95ed\", onclick=\"this.getparent('li').dispose();cookie.write('weibo_competition_hide', 1, {duration: 30});\")--></div></li><li"),buf.push(attrs({id:"share_to_weibo","class":"share-btn"})),buf.push("><span>\u5fae\u535a</span></li><li"),buf.push(attrs({id:"share_to_douban","class":"share-btn"})),buf.push("><span>\u8c46\u74e3</span></li><li"),buf.push(attrs({id:"share_to_Qzone","class":"share-btn"})),buf.push("><span>\u7a7a\u95f4</span></li></ul></div></div></div></div><div"),buf.push(attrs({"class":"hidden"})),buf.push(">");var __val__=emerge("_categories_cell");buf.push(null==__val__?"":__val__),buf.push('</div><script>(function(){app.initFollowButtons(),app.initLikeButtons(),app.initDelCommentButtons(),app.initAddCommentButtons(),app.initReplyButtons()})(),function(a){var b=$("pin_img"),c=b.get("data-id"),d="http://"+app.host+"/pins/"+c+"/",e=b.getElement("img").get("src"),f=$("pin_caption").getElement("p.text").get("text")||"\u521a\u521a\u5206\u4eab\u81ea\u82b1\u74e3\u7f51\u7684\u56fe\u7247\uff0c\u6765\u770b\u770b\u5427 ",g=b.get("data-media-type");if(g&&g==1){var h=b.get("data-orig-source"),i=new Swiff(h,{id:c,width:550,height:460,params:{allowfullscreen:!0}});b.getChildren().hide(),b.adopt(i);var j=b.getElements("a")?b.getElement("a").get("href"):"";f+=" "+j}$$(".share-btn").addEvent("click",function(){var b=["url="+a(d)];if(this.id=="share_to_weibo"){var c="http://v.t.sina.com.cn/share/share.php?";b.push("&appkey=2499394483"),b.push("&pic="+a(e)),b.push("&ralateUid=2493118952"),b.push("&title="+a(f))}else if(this.id=="share_to_douban"){var c="http://www.douban.com/recommend/?";b.push("&title="+a(f)),b.push("&comment="+a(f))}else if(this.id=="share_to_Qzone"){var c="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?";b.push("&title="+a(f)),b.push("&pics="+a(e))}b=b.join(""),function(a,d,e){function f(){window.open([c,b].join(""),"mb",["toolbar=0,status=0,resizable=1,width=620,height=450,left=",(a.width-620)/2,",top=",(a.height-450)/2].join(""))||(u.href=[c,b].join(""))}/Firefox/.test(navigator.userAgent)?setTimeout(f,0):f()}(screen,document,encodeURIComponent)});var k=$("pin_source");if(k){var l=k.getElement("a").get("html");if(~l.indexOf("item.taobao.com")||~l.indexOf("tmall.com")){var m=a(app.url(app.page.$url)),n=a(app.req.user?app.req.user.urlname:"");$$("a.jd-link").each(function(b){b.set("href","http://r.juandou.com/ju?p=10049510&to="+a(b.get("href"))+"&from="+m+"&c="+n)})}}var o,p,q=app.getState().id,r="/pins/"+c+"/zoom/",s=function(){o||(o=Elements.from(app.render("_pin_view_zoom"))[0],o.getElement("#zoomr_hide").addEvent("click",function(){return app.popState(),!1})),p=o.retrieve("slide"),p||(p=new SlidePage(o,{fixedSelector:"#pin_toolbar"}),o.store("slide",p)),o.inject(document.body).show(),app.messager&&(app.messager.detach(),app.messager.hideIndicator(!0)),p.show().chain(function(){o.setStyles({width:"100%",height:"auto"})}),app.registerStateHandler(q,t)},t=function(){if(!o)return;p=o.retrieve("slide"),p.hide().chain(function(){app.messager&&(app.messager.showIndicator(!0),app.messager.attach()),o.destroy(),o=null}),app.removeStateHandler(q)};app.registerStateHandler(r,s),$("zoomr_show").addEvent("click",function(a){return app.pushState(null,null,r),!1});var v=document.id("more_comments");if(v){var w=document.id("pin_comments"),x=w.getElement(".comment:not(#more_comments)").get("data-id"),y=20,z=!1;v.addEvents({click:function(a){z=!0,v.tween("opacity",.3),(new Request.JSON({url:"/pins/"+c+"/comments/",data:{max:x,limit:y},onSuccess:function(a){if(a.err)return alert(a.msg);var b=a.comments.reverse(),c;b.each(function(a,b){a.pin=app.page.pin;var d=app.render("_comment_item",a),e=Elements.from(d).inject(v,"after");b===0&&(c=e[0]),e.highlight()}),(new Fx.Scroll(window,{duration:"normal"})).toElementCenter(c);if(b.length<y)return v.dispose();x=b[b.length-1].comment_id,v.tween("opacity",1)}})).get()}})}}(encodeURIComponent)</script>')}return buf.join("")},__t._pin_view_zoom=function(locals){var buf=[];with(locals||{}){var interp,pin=page.pin;buf.push("<div"),buf.push(attrs({id:"zoomr"})),buf.push("><div"),buf.push(attrs({id:"zoomr_toolbar"})),buf.push("><div"),buf.push(attrs({"class":"bg"})),buf.push("></div><div"),buf.push(attrs({"class":"fg"})),buf.push("><a"),buf.push(attrs({id:"zoomr_logo",href:"/"})),buf.push("><img"),buf.push(attrs({src:"/img/logo_grey.png",width:"98",height:"34",alt:"\u82b1\u74e3"})),buf.push("/></a><a"),buf.push(attrs({id:"zoomr_hide",href:"/pins/"+pin.pin_id+"/",title:"\u8fd4\u56de"})),buf.push(">\u8fd4\u56de</a></div></div><div"),buf.push(attrs({id:"zoomr_body"})),buf.push("><img"),buf.push(attrs({id:"zoomr_img",src:""+imgURL(pin.file,suffix="")+"",width:""+pin.file.width+"",height:""+pin.file.height+"",alt:"\u91c7\u96c6\u56fe\u7247"})),buf.push("/></div></div>")}return buf.join("")},__t._pointy_tip=function(locals){var buf=[];with(locals||{}){var interp;buf.push("<div"),buf.push(attrs({id:""+id+"","class":"pointy-tip"})),buf.push("><div"),buf.push(attrs({"class":"pointy-tip-body"})),buf.push("><span"),buf.push(attrs({"class":"arrow"})),buf.push(">\u25e3</span><span"),buf.push(attrs({"class":"arrow-mask"})),buf.push("></span>"),content&&(buf.push("<a"),buf.push(attrs({href:"javascript:void(0);","class":"close"})),buf.push("></a>"));if(title){buf.push("<h5"),buf.push(attrs({"class":"title"})),buf.push(">");var __val__=title;buf.push(null==__val__?"":__val__),buf.push("</h5>")}if(content){buf.push("<div"),buf.push(attrs({"class":"content"})),buf.push(">");var __val__=content;buf.push(null==__val__?"":__val__),buf.push("</div>")}buf.push("</div></div>")}return buf.join("")},__t._search_result=function(locals){var buf=[];with(locals||{}){var interp,__val__=emerge("_header");buf.push(null==__val__?"":__val__),buf.push("<div"),buf.push(attrs({"class":"wrapper"})),buf.push("><div"),buf.push(attrs({id:"ctx_bar","class":"board"})),buf.push("><p>");var q=page.query,qt=escape(q.text),b=[],m=[[page.pin_count,"pin","\u91c7\u96c6","/"],[page.board_count,"board","\u753b\u677f","/boards/"],[page.people_count,"people","\u7528\u6237","/people/"]];for(var i=0,$$l=m.length;i<$$l;i++){var x=m[i];if(q.type==x[1]){buf.push("<span"),buf.push(attrs({"class":"selected"})),buf.push(">");var __val__=x[0]+" "+x[2];buf.push(null==__val__?"":__val__),buf.push("</span>")}else{buf.push("<a"),buf.push(attrs({href:"/search"+x[3]+"?q="+qt})),buf.push(">");var __val__=x[0]+" "+x[2];buf.push(null==__val__?"":__val__),buf.push("</a>")}i!==m.length-1&&buf.push("&nbsp;\u00b7&nbsp;")}buf.push("<span"),buf.push(attrs({"class":"greyselected"})),buf.push(">\u2014 \u641c\u7d22\u7ed3\u679c: <span"),buf.push(attrs({"class":"hilight"})),buf.push(">"+escape((interp=qt)==null?"":interp)+"<span></span></span></span></p></div><div"),buf.push(attrs({id:"waterfall"})),buf.push(">");if(q.type=="pin")for(var $index=0,$$l=page.pins.length;$index<$$l;$index++){var pin=page.pins[$index],__val__=emerge("_pin_item",{user:pin.user,pin:pin,board:pin.board});buf.push(null==__val__?"":__val__)}else if(q.type=="board")for(var $index=0,$$l=page.boards.length;$index<$$l;$index++){var board=page.boards[$index],__val__=emerge("_board_item",{board:board,user:req.user});buf.push(null==__val__?"":__val__)}else if(q.type=="people")for(var $index=0,$$l=page.users.length;$index<$$l;$index++){var user=page.users[$index],__val__=emerge("_user_item",{user:user,current_user:this.req.user});buf.push(null==__val__?"":__val__)}buf.push("</div></div><script>(function(){app.initLikeButtons(),app.initAddCommentButtons(),app.initFollowButtons(),app.initFollowUserButtons()})()</script>")}return buf.join("")},__t._unauth_callout=function(locals){var buf=[];with(locals||{}){var interp;buf.push("<div"),buf.push(attrs({id:"unauth_callout"})),buf.push("><div"),buf.push(attrs({"class":"wrapper"})),buf.push("><div"),buf.push(attrs({id:"intro"})),buf.push("><div"),buf.push(attrs({"class":"unauth-btns"})),buf.push(">"),page.isQplus?(buf.push("<a"),buf.push(attrs({id:"qplus_login_btn",href:"#",onclick:"return false;","class":"btn btn18 wbtn"})),buf.push('><strong><em></em> \u767b\u5f55</strong><span></span></a><script>(function(){qplus&&window.addEvent("domready",function(){new Button("qplus_login_btn",{click:function(){(new Request.JSON({url:"/qplus/params/",onSuccess:function(a){if(a.err)return alert(a.msg);qplus.user.auth(a.querystring,function(a){self.location.href="/oauth/qplus/?"+a.param})}})).get()}})})})()</script>')):(buf.push("<a"),buf.push(attrs({href:"/signup/","class":"btn btn18 rbtn"})),buf.push("><strong> \u7acb\u5373\u6ce8\u518c \u00bb</strong><span></span></a><a"),buf.push(attrs({id:"login_btn",href:"/login/","class":"btn btn18 wbtn"})),buf.push("><strong><em></em> \u767b\u5f55</strong><span></span></a>")),buf.push("</div><a"),buf.push(attrs({id:"mv_trigger_callout",href:"#",onclick:"app.showDialog('mv');return false;",title:"\u89c2\u770b\u89c6\u9891\uff0c\u4e86\u89e3\u5230\u82b1\u74e3\u7f51\uff0c\u5e2e\u4f60\u91c7\u96c6\uff0c\u53d1\u73b0\u7f51\u7edc\u4e0a\u4f60\u559c\u6b22\u7684\u7f8e\u597d\u4e8b\u7269\u3002\u4f60\u53ef\u4ee5\u7528\u5b83\u6536\u96c6\u7075\u611f\uff0c\u4fdd\u5b58\u6709\u7528\u7684\u7d20\u6750\uff0c\u8ba1\u5212\u65c5\u884c\uff0c\u6652\u6652\u81ea\u5df1\u60f3\u8981\u7684\u5bb6\u5c45\uff0c \u670d\u9970\u642d\u914d\uff0c\u53d1\u578b\u548c\u5a5a\u7eb1.","class":"mv"})),buf.push("></a><h2>\u82b1\u74e3\uff0c</h2>\u91c7\u96c6\u4f60\u559c\u6b22\u7684\u3002</div></div></div>")}return buf.join("")},__t._user_item=function(locals){var buf=[];with(locals||{}){var interp;buf.push("<div"),buf.push(attrs({"data-id":""+user.user_id+"","data-seq":""+user.user_id+"","class":"pin user wfc"})),buf.push("><a"),buf.push(attrs({href:"/"+escape(user.urlname)+"/",title:escape(user.username),"class":"img x"})),buf.push("><img"),buf.push(attrs({src:avatar(user,"fw192")})),buf.push("/></a><h2>"+escape((interp=user.username)==null?"":interp)+"</h2><p"),buf.push(attrs({"class":"location less"})),buf.push("></p>"),current_user&&(current_user.user_id!==user.user_id?user.following?(buf.push("<a"),buf.push(attrs({"data-id":user.urlname,href:"#",onclick:"return false;","class":"unfollowuser btn btn13 wbtn"})),buf.push("><strong> \u53d6\u6d88\u5173\u6ce8</strong><span></span></a>")):(buf.push("<a"),buf.push(attrs({"data-id":user.urlname,href:"#",onclick:"return false;","class":"followuser btn btn13 wbtn"})),buf.push("><strong> \u5173\u6ce8</strong><span></span></a>")):(buf.push("<a"),buf.push(attrs({href:"/settings/","class":"btn btn13 wbtn"})),buf.push("><strong> \u5e10\u53f7\u8bbe\u7f6e</strong><span></span></a>"))),buf.push("</div>")}return buf.join("")},__t._message=function(locals){var buf=[];with(locals||{}){var interp,cur=messages.message_type;if(cur=="mentions")var pins=messages.pins,unread_mentions=messages.unread_mentions;if(cur=="activities")var feeds=messages.feeds,unread_feeds=messages.unread_feeds;buf.push("<div"),buf.push(attrs({id:"msgl"})),buf.push("><div"),buf.push(attrs({id:"msgl_header"})),buf.push("><div"),buf.push(attrs({"class":"bg"})),buf.push("></div><div"),buf.push(attrs({"class":"fg"})),buf.push("><div"),buf.push(attrs({"class":"wrapper"})),buf.push("><a"),buf.push(attrs({id:"msgl_logo",href:"/"})),buf.push("><img"),buf.push(attrs({src:"/img/logo_grey.png",width:"98",height:"34",alt:"\u82b1\u74e3"})),buf.push("/></a><a"),buf.push(attrs({id:"msgl_hide",href:"/",title:"\u8fd4\u56de"})),buf.push(">\u8fd4\u56de</a></div></div></div><div"),buf.push(attrs({id:"msgl_body"})),buf.push("><div"),buf.push(attrs({"class":"wrapper"})),buf.push("><ul"),buf.push(attrs({"class":"nav"})),buf.push(">"),cur=="mentions"?(buf.push("<li"),buf.push(attrs({"class":"mentions current"})),buf.push("><a"),buf.push(attrs({href:"/message/mentions/"})),buf.push(">@\u63d0\u5230\u6211\u7684</a></li>")):(buf.push("<li"),buf.push(attrs({"class":"mentions"})),buf.push("><a"),buf.push(attrs({href:"/message/mentions/"})),buf.push(">@\u63d0\u5230\u6211\u7684</a></li>")),cur=="activities"?(buf.push("<li"),buf.push(attrs({"class":"activities current"})),buf.push("><a"),buf.push(attrs({href:"/message/activities/"})),buf.push(">\u6211\u7684\u6d88\u606f</a></li>")):(buf.push("<li"),buf.push(attrs({"class":"activities"})),buf.push("><a"),buf.push(attrs({href:"/message/activities/"})),buf.push(">\u6211\u7684\u6d88\u606f</a></li>")),buf.push("</ul>");if(cur=="mentions"){var __val__=emerge("_mentions_list",{pins:pins,unread_mentions:unread_mentions});buf.push(null==__val__?"":__val__)}if(cur=="activities"){var __val__=emerge("_activities_list",{feeds:feeds,unread_feeds:unread_feeds});buf.push(null==__val__?"":__val__)}buf.push('</div></div></div><script>(function(){var a=app._prepath||"/";delete app._prepath,$("msgl_hide").set("href",a)})()</script>')}return buf.join("")},__t._activities_list=function(locals){var buf=[];with(locals||{}){var interp;buf.push("<ol"),buf.push(attrs({"class":"activities"})),buf.push(">");for(var $index=0,$$l=feeds.length;$index<$$l;$index++){var f=feeds[$index],__val__=emerge("_activities_list_item",{f:f,unread_feeds:unread_feeds});buf.push(null==__val__?"":__val__)}buf.push("</ol><a"),buf.push(attrs({"class":"load-more"})),buf.push('><strong>\u66f4\u591a</strong><span></span></a><script>(function(){Browser.ie6&&(document.id("msgl_body").setStyle("height",document.html.clientHeight-61),document.id("msgl").setStyle("height",document.html.clientHeight));var a=document.getElement("ol.activities"),b=a.getNext("a.load-more"),c=20;if(!b)return;new Button(b,{click:function(){var d=a.getLast("li"),e=this.disable();(new Request.JSON({url:location.href,data:{max:d.get("data-id"),limit:c},noCache:!0,onSuccess:function(c){if(c.err)return alert(c.msg);if(c.messages.feeds.length){var d="";c.messages.feeds.each(function(a){d+=app.render("_activities_list_item",{f:a,req:app.req,user:a.user,unread_feeds:c.messages.unread_feeds})});var f=Elements.from(d);a.adopt(f),b.inject(a,"bottom")}c.messages.feeds.length==0?e.setTitle("\u771f\u7684\u6728\u6709\u4e86"):e.enable()}})).get()}})})()</script>')}return buf.join("")},__t._activities_list_item=function(locals){var buf=[];with(locals||{}){var interp,u=f.user,t=f.content.type,p=f.pin,b=f.board,fu=f.follow_user,tu=this.req.user?this.req.user.user_id:-1,ulink='<a href="/'+u.urlname+'/">'+(tu===u.user_id?"\u4f60":u.username)+"</a>",is_unread="";~unread_feeds.indexOf(f.feed_id.toString())&&(is_unread="unread"),buf.push("<li"),buf.push(attrs({"data-id":""+f.feed_id+"","class":""+is_unread+""})),buf.push("><a"),buf.push(attrs({href:"/"+u.urlname+"/",title:""+u.username+"","class":"item"})),buf.push("><img"),buf.push(attrs({width:"75px",height:"75px",src:avatar(u,"sq75")})),buf.push("/></a><div"),buf.push(attrs({"class":"content"})),buf.push("><div"),buf.push(attrs({"class":"inner"})),buf.push(">");if(t=="pin"){buf.push("<a"),buf.push(attrs({href:"/pins/"+p.pin_id+"/","class":"img"})),buf.push("><img"),buf.push(attrs({src:imgURL(p.file,"sq75")})),buf.push("/></a><div"),buf.push(attrs({"class":"detail"})),buf.push("><p"),buf.push(attrs({"class":"ulink"})),buf.push(">");var __val__=ulink;buf.push(null==__val__?"":__val__),buf.push("</p>&nbsp;\u91c7\u96c6&nbsp;<a"),buf.push(attrs({href:"/pins/"+p.pin_id+"/"})),buf.push(">");var __val__=p.raw_text.brief(40);buf.push(null==__val__?"":__val__),buf.push("</a>&nbsp;\u5230&nbsp;<a"),buf.push(attrs({href:"/boards/"+p.board_id+"/"})),buf.push(">");var __val__=p.board.title.brief(38);buf.push(null==__val__?"":__val__),buf.push("</a></div>")}else if(t=="repin"){buf.push("<a"),buf.push(attrs({href:"/pins/"+p.pin_id+"/","class":"img"})),buf.push("><img"),buf.push(attrs({src:imgURL(p.file,"sq75")})),buf.push("/></a>");var vu=p.via_user,vul='<a href="/'+vu.urlname+'/">'+(tu===vu.user_id?"\u4f60":vu.username)+"</a>";buf.push("<div"),buf.push(attrs({"class":"detail"})),buf.push("><p"),buf.push(attrs({"class":"ulink"})),buf.push(">");var __val__=ulink;buf.push(null==__val__?"":__val__),buf.push("</p>&nbsp;\u901a\u8fc7&nbsp;");var __val__=vul;buf.push(null==__val__?"":__val__),buf.push("&nbsp;\u8f6c\u91c7\u4e86&nbsp;<a"),buf.push(attrs({href:"/pins/"+p.pin_id+"/"})),buf.push(">");var __val__=p.raw_text.brief(40);buf.push(null==__val__?"":__val__),buf.push("</a>&nbsp;\u5230&nbsp;<a"),buf.push(attrs({href:"/boards/"+p.board_id+"/"})),buf.push(">");var __val__=p.board.title.brief(38);buf.push(null==__val__?"":__val__),buf.push("</a></div>")}else if(t=="like"){buf.push("<a"),buf.push(attrs({href:"/pins/"+p.pin_id+"/","class":"img"})),buf.push("><img"),buf.push(attrs({src:imgURL(p.file,"sq75")})),buf.push("/></a><div"),buf.push(attrs({"class":"detail"})),buf.push("><p"),buf.push(attrs({"class":"ulink"})),buf.push(">");var __val__=ulink;buf.push(null==__val__?"":__val__),buf.push("</p>&nbsp;\u559c\u6b22\u7531&nbsp;<a"),buf.push(attrs({href:"/"+p.user.urlname+"/"})),buf.push(">");var __val__=tu===p.user.user_id?"\u4f60":p.user.username;buf.push(null==__val__?"":__val__),buf.push("</a>&nbsp;\u91c7\u96c6\u7684&nbsp;<a"),buf.push(attrs({href:"/pins/"+p.pin_id+"/"})),buf.push(">");var __val__=p.raw_text.brief(40);buf.push(null==__val__?"":__val__),buf.push("</a></div>")}else if(t=="comment"){buf.push("<a"),buf.push(attrs({href:"/pins/"+p.pin_id+"/","class":"img"})),buf.push("><img"),buf.push(attrs({src:imgURL(p.file,"sq75")})),buf.push("/></a><div"),buf.push(attrs({"class":"detail"})),buf.push("><p"),buf.push(attrs({"class":"ulink"})),buf.push(">");var __val__=ulink;buf.push(null==__val__?"":__val__),buf.push("</p>&nbsp;\u8bc4\u8bba\u4e86\u7531&nbsp;<a"),buf.push(attrs({href:"/"+p.user.urlname+"/"})),buf.push(">");var __val__=tu===p.user.user_id?"\u4f60":p.user.username;buf.push(null==__val__?"":__val__),buf.push("</a>&nbsp;\u91c7\u96c6\u7684&nbsp;<a"),buf.push(attrs({href:"/pins/"+p.pin_id+"/"})),buf.push(">");var __val__=p.raw_text.brief(40);buf.push(null==__val__?"":__val__),buf.push("</a></div>")}else if(t=="follow"){buf.push("<div"),buf.push(attrs({"class":"detail"})),buf.push("><p"),buf.push(attrs({"class":"ulink"})),buf.push(">");var __val__=ulink;buf.push(null==__val__?"":__val__),buf.push("</p>&nbsp;\u5173\u6ce8\u4e86&nbsp;<a"),buf.push(attrs({href:"/"+b.user.urlname+"/"})),buf.push(">");var __val__=tu===b.user.user_id?"\u4f60":b.user.username;buf.push(null==__val__?"":__val__),buf.push("</a>&nbsp;\u7684\u753b\u677f&nbsp;<a"),buf.push(attrs({href:"/boards/"+b.board_id+"/"})),buf.push(">");var __val__=b.title.brief(38);buf.push(null==__val__?"":__val__),buf.push("</a></div>")}else if(t=="follow_people"){buf.push("<div"),buf.push(attrs({"class":"detail"})),buf.push("><p"),buf.push(attrs({"class":"ulink"})),buf.push(">");var __val__=ulink;buf.push(null==__val__?"":__val__),buf.push("</p>&nbsp;\u5173\u6ce8\u4e86&nbsp;<a"),buf.push(attrs({href:"/"+fu.urlname+"/"})),buf.push(">");var __val__=tu===fu.user_id?"\u4f60":fu.username;buf.push(null==__val__?"":__val__),buf.push("</a></div>")}buf.push("<div"),buf.push(attrs({"class":"clear-right"})),buf.push("></div></div></div></li>")}return buf.join("")},__t._mentions_list=function(locals){var buf=[];with(locals||{}){var interp;user=this.req.user,buf.push("<ol"),buf.push(attrs({"class":"mentions"})),buf.push(">");for(var $index=0,$$l=pins.length;$index<$$l;$index++){var p=pins[$index],__val__=emerge("_mentions_list_item",{p:p,user:user,unread_mentions:unread_mentions});buf.push(null==__val__?"":__val__)}buf.push("</ol><a"),buf.push(attrs({"class":"load-more"})),buf.push('><strong>\u66f4\u591a</strong><span></span></a><script>(function(){Browser.ie6&&(document.id("msgl_body").setStyle("height",document.html.clientHeight-61),document.id("msgl").setStyle("height",document.html.clientHeight));var a=function(){var a=document.getElement("ol.mentions");if(a.retrieve("delcommentbutton"))return;a.addEvent("click:relay(.comment a.del)",function(a){app.forceLogin();var b=a.target;b.get("tag")!=="a"&&(b=b.getParent("a"));var c=b.get("href");return(new Request.JSON({url:c,data:{_method:"DELETE"},onSuccess:function(a){if(a.err)return alert(a.msg);var c=b.getParent(".comment");if(c){var d=c.getParent("ul");if(d.getElements("li").length==1){var e=d.getParent("li.mention-pin");e.tween("opacity",0).get("tween").chain(function(){e.destroy()})}else c.tween("opacity",0).get("tween").chain(function(){c.destroy(),c.hasClass("first")?d.getFirst("li").addClass("first"):c.hasClass("last")&&d.getLast("li").addClass("first")})}}})).post(),!1}),a.store("delcommentbutton",!0)},b=function(){var a=document.getElement("ol.mentions");if(a.retrieve("replycommentbutton"))return;a.addEvent("click:relay(.comment a.reply)",function(a){app.forceLogin();var b=a.target;b.get("tag")!=="a"&&(b=b.getParent("a"));var c=b.getParent(".comment");if(!c)return;var d=b.getParent(".comment").getElement("div.reply");d.setStyle("display","block");var e=d.getElement("textarea");return e.set("text","@"+c.get("data-author-name")+" ").setCaretPosition("end"),d.getElement("a.btn").removeClass("disabled"),e.get("registered-at")||(e.set("registered-at","registered"),new Autocompleter.Contacts.At(e)),!1}),a.store("replycommentbutton",!0)},c=function(){var a=document.getElement("ol.mentions");if(a.retrieve("cancelcommentbutton"))return;a.addEvent("click:relay(.comment a.cancel)",function(a){var b=a.target,c=b.getParent("div.reply");return c.setStyle("display","none"),c.getElement("a.btn").addClass("disabled"),!1}),a.store("cancelcommentbutton",!0)},d=function(){var a=document.getElement("ol.mentions");if(a.retrieve("submitcommentbutton"))return;a.addEvent("click:relay(a.PostReply)",function(a){var b=a.target;b.get("tag")!=="a"&&(b=b.getParent("a"));var c=b.getParent("form"),d=c.getElement("textarea"),e=b.getParent("ul.content"),f=d.get("value").trim();return f==""||f=="\u6dfb\u52a0\u8bc4\u8bba..."?(d.highlight(),!1):((new Request.JSON({url:c.get("action"),data:{text:f},onSuccess:function(a){if(a.err)alert(a.msg);else{var c=b.getParent("div.reply");c.setStyle("display","none"),c.getElement("a.btn").addClass("disabled"),d.set("value","");var f=app.render("_mentions_comment_item",{p:a.comment.pin,comment:a.comment,user:a.comment.user,first:!0,last:!1}),g=e.getElement("li.comment.first");g.removeClass("first");var h=Elements.from(f).inject(g,"before");e.isDisplayed()||e.show(),h.highlight("#EEE")}b.removeClass("disabled")},onFailure:function(){alert("\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5"),b.removeClass("disabled")}})).post(),!1)}),a.store("submitcommentbutton",!0)},e=function(){var a=document.getElement("ol.mentions"),b=a.getNext("a.load-more"),c=1,d=10;if(!b)return;new Button(b,{click:function(){var e=a.getLast("li"),f=this.disable();(new Request.JSON({url:location.href,data:{page:c+1,per_page:d},noCache:!0,onSuccess:function(d){if(d.err)return alert(d.msg);if(d.messages.pins.length){var e="";d.messages.pins.each(function(a){e+=app.render("_mentions_list_item",{p:a,user:a.user,unread_mentions:d.messages.unread_mentions})});var g=Elements.from(e);a.adopt(g),b.inject(a,"bottom"),c+=1}d.messages.pins.length==0?f.setTitle("\u771f\u7684\u6728\u6709\u4e86"):f.enable()}})).get()}})};a(),b(),c(),d(),e()})()</script>')}return buf.join("")},__t._mentions_list_item=function(locals){var buf=[];with(locals||{}){var interp,u=p.user,cls=p.is_unread?"unread":"";if(p.metas||p.comments.length>0){buf.push("<li"),buf.push(attrs({"data-id":""+p.pin_id+"","class":"mention-pin clearfix "+(""+cls+"")})),buf.push("><a"),buf.push(attrs({href:"/pins/"+p.pin_id+"/","class":"img item"})),buf.push("><img"),buf.push(attrs({src:imgURL(p.file,"sq75")})),buf.push("/></a><ul"),buf.push(attrs({"class":"content"})),buf.push(">");var i=0,c,first=last=has_text=!1;if(p.metas){first=has_text=!0,p.comments.length<=0&&(last=!0);var __val__=emerge("_mentions_comment_item",{p:p,first:first,last:last,user:user,unread_mentions:unread_mentions});buf.push(null==__val__?"":__val__)}for(i=0;i<p.comments.length;i++){var __val__=emerge("_mentions_comment_item",{p:p,comment:p.comments[i],first:!has_text&&i==0,last:i==p.comments.length-1,user:user,unread_mentions:unread_mentions});buf.push(null==__val__?"":__val__)}buf.push("</ul></li>")}}return buf.join("")},__t._mentions_comment_item=function(locals){var buf=[];with(locals||{}){var interp,is_pin=typeof comment=="undefined",obj=is_pin?p:comment,obj_id=is_pin?p.pin_id:comment.comment_id,cls=first?"first":"";cls=cls+" "+(last?"last":"");var tu=this.req.user?this.req.user.user_id:-1,cu=obj.user,ulink='<a class="author" href="/'+cu.urlname+'/">'+(tu===cu.user_id?"\u4f60":cu.username)+"</a>",metas=obj.metas||null,is_unread="",_prefix=is_pin?"p:":"c:";typeof unread_mentions!="undefined"&&~unread_mentions.indexOf(_prefix+obj_id)&&(is_unread="unread"),buf.push("<li"),buf.push(attrs({"data-id":""+obj_id+"","data-author-name":""+cu.username+"","class":"comment "+(""+cls+" "+is_unread+"")})),buf.push("><div"),buf.push(attrs({"class":"inner"})),buf.push("><a"),buf.push(attrs({href:"/"+cu.urlname+"/",title:""+cu.username+""})),buf.push("><img"),buf.push(attrs({width:"75px",height:"75px",src:avatar(cu,"sq75")})),buf.push("/></a><div"),buf.push(attrs({"class":"detail"})),buf.push("><p"),buf.push(attrs({"class":"ulink"})),buf.push(">");var __val__=ulink;buf.push(null==__val__?"":__val__),buf.push("&nbsp;<span"),buf.push(attrs({"data-ts":""+obj.created_at+"","class":"ts-words"})),buf.push(">"+escape((interp=Date.timeAgo(obj.created_at))==null?"":interp)+"</span>\u8bf4\uff1a</p><p"),buf.push(attrs({"class":"text"})),buf.push(">");var __val__=obj.raw_text.format_text(metas);buf.push(null==__val__?"":__val__),buf.push("</p><div"),buf.push(attrs({"class":"acts"})),buf.push(">"),!is_pin&&(cu.user_id===tu||p.user_id===tu)&&(buf.push("<a"),buf.push(attrs({title:"\u5220\u9664",href:"/pins/"+p.pin_id+"/comments/"+obj.comment_id+"/",onclick:"return false;","class":"del"})),buf.push(">\u5220\u9664</a>")),cu.user_id!==tu&&(buf.push("<a"),buf.push(attrs({title:"\u56de\u590d",href:"javascript:;",onclick:"return false;","class":"reply"})),buf.push(">\u56de\u590d</a>")),buf.push("</div></div><div"),buf.push(attrs({style:"display: none;","class":"reply clearfix"})),buf.push("><a"),buf.push(attrs({href:"/"+escape(user.urlname)+"/",title:escape(user.username),"class":"img x"})),buf.push("><img"),buf.push(attrs({src:avatar(user,undefined)})),buf.push("/></a><form"),buf.push(attrs({action:"/pins/"+p.pin_id+"/comments/",method:"POST"})),buf.push("><textarea"),buf.push(attrs({placeholder:"\u6dfb\u52a0\u8bc4\u8bba...","class":"MentionComment"})),buf.push("></textarea><div"),buf.push(attrs({style:"display:block;","class":"PinAddCommentControls"})),buf.push("><a"),buf.push(attrs({href:"#",onclick:"return false;","class":"PostReply disabled btn btn13 gbtn"})),buf.push("><strong> \u6dfb\u52a0\u8bc4\u8bba</strong><span></span></a><a"),buf.push(attrs({href:"javascript:;","class":"cancel"})),buf.push(">\u53d6\u6d88</a></div></form></div><div"),buf.push(attrs({"class":"clear-right"})),buf.push("></div></div></li>")}return buf.join("")},__t._people_profile=function(locals){var buf=[];with(locals||{}){var interp;buf.push("<div"),buf.push(attrs({id:"Profile"})),buf.push("><div"),buf.push(attrs({"class":"profile-basic"})),buf.push("><a"),buf.push(attrs({href:"/"+escape(user.urlname)+"/",title:escape(user.username),"class":"img x"})),buf.push("><img"),buf.push(attrs({width:"64px",height:"64px",src:avatar(user,"sq75")})),buf.push("/></a><a"),buf.push(attrs({href:"/"+user.urlname+"/","class":"userlink"})),buf.push(">"+escape((interp=user.username)==null?"":interp)+"</a><a"),buf.push(attrs({href:"/settings/","class":"settings"})),buf.push(">\u5e10\u53f7\u8bbe\u7f6e</a></div><div"),buf.push(attrs({"class":"profile-stats"})),buf.push("><a"),buf.push(attrs({href:"/"+user.urlname+"/pins/"})),buf.push("><strong>"+escape((interp=user_info.pin_count)==null?"":interp)+"</strong>\u91c7\u96c6</a><a"),buf.push(attrs({href:"/"+user.urlname+"/"})),buf.push("><strong>"+escape((interp=user_info.board_count)==null?"":interp)+"</strong>\u753b\u677f</a><a"),buf.push(attrs({href:"/"+user.urlname+"/followers/"})),buf.push("><strong>"+escape((interp=user_info.follower_count)==null?"":interp)+"</strong>\u7c89\u4e1d</a></div><div"),buf.push(attrs({"class":"profile-acts convo"})),buf.push("><div"),buf.push(attrs({"class":"links"})),buf.push("><a"),buf.push(attrs({href:"/invites/","class":"btn wbtn"})),buf.push("><strong><em></em> \u67e5\u627e\u9080\u8bf7\u597d\u53cb</strong><span></span></a></div><a"),buf.push(attrs({color:"red",href:"#",onclick:"app.showDialog('add'); return false;",title:"\u6dfb\u52a0",size:"11","class":"add"})),buf.push(">\u6dfb\u52a0</a></div></div>")}return buf.join("")}}(app),function(a){var b=a.routers||[],c=a.map=function(a,c){typeof a=="string"&&(a=new RegExp(a)),b.push([a,c])},d=a.route=function(b){var c=a.getRouter(b);if(c){var d=c.call(this,this);return this.onRoute&&this.onRoute(d),d}return!1};return a.getRouter=function(a){a=(a||this.page.$url).split("?")[0];for(var c=0,d=b.length;c<d;c++)if(b[c][0].test(a))return b[c][1];return null},c(/^\/((all|following|from|popular|favorite)(\/([^\/]+))?)?\/?$/,function(b){var c=a.view||{};return b.page.show_categories_bar=!b.page.filter||!~b.page.filter.indexOf("site:"),b.render("_index",c,function(a,d){c.show(),b.page.$waterfall=(new Waterfall("waterfall",{fetcher:!~b.page.$url.indexOf("popular"),loader:b.createCellLoader(b.page.$url,20,function(a){return{data:a.pins}})})).reposition()})}),c(/^\/boards\/((all|following|popular)(\/([^\/]+))?)?\/?$/,function(b){var c=a.view||{};return b.page.show_categories_bar=!0,b.render("_index",c,function(a,d){c.show(),b.page.$waterfall=(new Waterfall("waterfall",{loader:b.createCellLoader(b.page.$url,20,function(a){return{data:a.boards}})})).reposition()})}),c(/^\/search(\/(pins|boards|people))?\/?$/,function(b){var c=a.view||{};return b.render("_search_result",c,function(a,d){c.show(),b.page.$waterfall=(new Waterfall("waterfall",{loader:b.createCellLoader(b.page.$url,20,1,function(a){var c=b.page.query.type=="people"?"users":b.page.query.type+"s";return{data:a[c]}})})).reposition()})}),c(/^\/pins\/\d+\/?$/,function(b){var c=a.view||{},d=b.page,e=d.pin;return d.title=e.user.username+"\u91c7\u96c6\u5230"+e.board.title+" - \u82b1\u74e3",b.render("_pin_view",c,function(a,b){return c.addClass("view").show(),!1})}),c(/^\/pins\/\d+\/zoom\/?$/,function(b){var c=a.view||{},d=b.page,e=d.pin;return d.title=e.user.username+"\u91c7\u96c6\u5230"+e.board.title+" - \u82b1\u74e3",b.render("_pin_view_zoom",c,function(a,b){return c.addClass("view").show(),!1})}),c(/^\/boards\/\d+\/?$/,function(b){var c=a.view||{},d=b.page,e=d.board;return d.show_pin_source=!0,d.title=e.user.username+" - \u82b1\u74e3\u753b\u677f",b.render("_board_view",c,function(a,d){c.show(),b.page.show_pin_source=!0,b.page.$waterfall=(new Waterfall("waterfall",{loader:b.createCellLoader(b.page.$url,20,function(a){return{data:a.board.pins,extra:{user:a.board.user,board:a.board}}})})).reposition()})}),c(/^\/bookmarklet\/?$/,function(b){var c=a.view||{};return b.page.hideNewIndicator=!0,b.render("_bookmarklet",c,function(a,b){$("bookmarklet").getElement(".pbt").show(),c.show()})}),c(/^\/bookmarklet_success\/?$/,function(b){var c=a.view||{};return b.page.hideNewIndicator=!0,b.render("_bookmarklet_success",c,function(a,b){c.show()})}),c(/^\/message\/(mentions|activities)\/?$/,function(b){var c=a.view||{};return b.page.hideNewIndicator=!0,b.render("_message",c,function(a,b){return c.addClass("view").show(),!1})}),c(/^\/_error\/?$/,function(b){var c=a.view||{};return b.render("_error",c,function(a,b){c.show()})}),c(/^\/[a-z0-9-_\.]+\/?$/,function(b){var c=a.view||{};return b.render("_people_boards",c,function(a,d){c.addClass("profile").show(),b.page.$waterfall=(new Waterfall("wrapper",{cellSelector:!1})).reposition()})}),c(/^\/[a-z0-9-_\.]+\/pins\/?$/,function(b){var c=a.view||{};return b.render("_people_pins",c,function(a,d){c.addClass("profile").show(),b.page.$waterfall=(new Waterfall("waterfall",{preservedCols:1,loader:b.createCellLoader(b.page.$url,20,function(a){var b=a.user.pins;return b.each(function(b){b.user=a.user}),{data:b}})})).reposition()})}),c(/^\/[a-z0-9-_\.]+\/likes\/?$/,function(b){var c=a.view||{};return b.render("_people_likes",c,function(a,d){c.addClass("profile").show(),b.page.$waterfall=(new Waterfall("waterfall",{preservedCols:1,loader:b.createCellLoader(b.page.$url,20,function(a){return{data:a.user.likes}})})).reposition()})}),a}(typeof exports=="undefined"?window.app:exports);var Autocompleter={},OverlayFix=IframeShim;Autocompleter.Base=new Class({Implements:[Options,Events],options:{minLength:1,markQuery:!0,width:"inherit",maxChoices:10,className:"autocompleter-choices",zIndex:42,delay:400,observerOptions:{},fxOptions:{},autoSubmit:!1,overflow:!1,overflowMargin:25,selectFirst:!1,filter:null,filterCase:!1,filterSubset:!1,forceSelect:!1,selectMode:!0,choicesMatch:null,multiple:!1,separator:", ",autoTrim:!0,allowDupes:!1,cache:!0,relative:!1},initialize:function(a,b){this.element=document.id(a),this.setOptions(b),this.options.separatorSplit=new RegExp("s*["+this.options.separator+"]s*"),this.build(),this.observer=new Observer(this.element,this.prefetch.bind(this),Object.merge({delay:this.options.delay},this.options.observerOptions)),this.queryValue=null,this.options.filter&&(this.filter=this.options.filter.bind(this));var c=this.options.selectMode;this.typeAhead=c=="type-ahead",this.selectMode=c===!0?"selection":c,this.cached=[]},build:function(){if(document.id(this.options.customChoices))this.choices=this.options.customChoices;else{this.choices=(new Element("ul",{"class":this.options.className,styles:{display:"none",zIndex:this.options.zIndex}})).inject(document.body),this.relative=!1;if(this.options.relative||this.element.getOffsetParent()!=document.body)this.choices.inject(this.element,"after"),this.relative=this.element.getOffsetParent(),function(){this.relative=this.element.getOffsetParent()}.bind(this).delay(1e3);this.fix=new OverlayFix(this.choices)}this.options.separator.test(this.options.separatorSplit)||(this.options.separatorSplit=this.options.separator),this.fx=this.options.fxOptions?(new Fx.Tween(this.choices,Object.merge({property:"opacity",link:"cancel",duration:200},this.options.fxOptions))).addEvent("onStart",Chain.prototype.clearChain).set(0):null,this.element.setProperty("autocomplete","off").addEvent(Browser.ie||Browser.chrome||Browser.safari?"keydown":"keypress",this.onCommand.bind(this)).addEvent("click",this.onCommand.bind(this,!1)).addEvent("focus",function(){this.toggleFocus.delay(100,this,[!0])}.bind(this))},destroy:function(){this.fix&&this.fix.dispose(),this.choices=this.selected=this.choices.destroy()},toggleFocus:function(a){this.focussed=a,a||this.hideChoices(!0),this.fireEvent(a?"onFocus":"onBlur",[this.element])},onCommand:function(a){if(!a&&this.focussed)return this.prefetch();if(a&&a.key&&!a.shift)switch(a.key){case"enter":case"tab":if(this.selected&&this.visible)return this.choiceSelect(this.selected),!!this.options.autoSubmit;break;case"up":case"down":if(!this.prefetch()&&this.queryValue!==null){var b=a.key=="up";return this.choiceOver((this.selected||this.choices)[this.selected?b?"getPrevious":"getNext":b?"getLast":"getFirst"](this.options.choicesMatch),!0),!1};case"esc":this.hideChoices(!0)}return!0},setSelection:function(a){var b=this.selected.inputValue,c=b,d=this.queryValue.length,e=b.length;b.substr(0,d).toLowerCase()!=this.queryValue.toLowerCase()&&(d=0);if(this.options.multiple){var f=this.options.separatorSplit;c=this.element.value,d+=this.queryIndex,e+=this.queryIndex;var g=c.substr(this.queryIndex).split(f,1)[0];c=c.substr(0,this.queryIndex)+b+c.substr(this.queryIndex+g.length);if(a){var h=/[^\s,]+/,i=c.split(this.options.separatorSplit).filter(h.test,h);this.options.allowDupes||(i=[].combine(i));var j=this.options.separator;c=i.join(j)+j,e=c.length}}this.observer.setValue(c),this.opted=c;if(a||this.selectMode=="pick")d=e;this.element.selectRange(d,e),this.fireEvent("onSelection",[this.element,this.selected,c,b])},showChoices:function(){var a=this.options.choicesMatch,b=this.choices.getFirst(a);this.selected=this.selectedValue=null;if(this.fix){var c=this.element.getCoordinates(this.relative),d=this.options.width||"auto";this.choices.setStyles({left:c.left,top:c.bottom,width:d===!0||d=="inherit"?c.width:d})}if(!b)return;this.visible||(this.visible=!0,this.choices.setStyle("display",""),this.fx&&this.fx.start(1),this.fireEvent("onShow",[this.element,this.choices])),(this.options.selectFirst||this.typeAhead||b.inputValue==this.queryValue)&&this.choiceOver(b,this.typeAhead);var e=this.choices.getChildren(a),f=this.options.maxChoices,g={overflowY:"hidden",height:""};this.overflown=!1;if(e.length>f){var h=e[f-1];g.overflowY="scroll",g.height=h.getCoordinates(this.choices).bottom,this.overflown=!0}this.choices.setStyles(g),this.fix.show()},hideChoices:function(a){if(a){var b=this.element.value;this.options.forceSelect&&(b=this.opted),this.options.autoTrim&&(b=b.split(this.options.separatorSplit).filter(function(){return arguments[0]}).join(this.options.separator)),this.observer.setValue(b)}if(!this.visible)return;this.visible=!1,this.observer.clear();var c=function(){this.choices.setStyle("display","none"),this.fix.hide()}.bind(this);this.fx?this.fx.start(0).chain(c):c(),this.fireEvent("onHide",[this.element,this.choices])},prefetch:function(){var a=this.element.value,b=a;if(this.options.multiple){var c=this.options.separatorSplit,d=a.split(c),e=this.element.getCaretPosition(),f=a.substr(0,e).split(c),g=f.length-1;e-=f[g].length,b=d[g]}if(b.length<this.options.minLength)this.hideChoices();else if(b===this.queryValue||this.visible&&b==this.selectedValue){if(this.visible)return!1;this.showChoices()}else this.queryValue=b,this.queryIndex=e,this.fetchCached()||this.query();return!0},fetchCached:function(){return!this.options.cache||!this.cached||!this.cached.length||this.cached.length>=this.options.maxChoices||this.queryValue?!1:(this.update(this.filter(this.cached)),!0)},update:function(a){this.choices.empty(),this.cached=a,!a||!a.length?this.hideChoices():(this.options.maxChoices<a.length&&!this.options.overflow&&(a.length=this.options.maxChoices),a.each(this.options.injectChoice||function(a){var b=new Element("li",{html:this.markQueryValue(a)});b.inputValue=a,this.addChoiceEvents(b).inject(this.choices)},this),this.showChoices())},choiceOver:function(a,b){if(!a||a==this.selected)return;this.selected&&this.selected.removeClass("autocompleter-selected"),this.selected=a.addClass("autocompleter-selected"),this.fireEvent("onSelect",[this.element,this.selected,b]);if(!b)return;this.selectedValue=this.selected.inputValue;if(this.overflown){var c=this.selected.getCoordinates(this.choices),d=this.options.overflowMargin,e=this.choices.scrollTop,f=this.choices.offsetHeight,g=e+f;c.top-d<e&&e?this.choices.scrollTop=Math.max(c.top-d,0):c.bottom+d>g&&(this.choices.scrollTop=Math.min(c.bottom-f+d,g))}this.selectMode&&this.setSelection()},choiceSelect:function(a){a&&this.choiceOver(a),this.setSelection(!0),this.queryValue=!1,this.hideChoices()},filter:function(a){return(a||this.tokens).filter(function(a){return this.test(a)},new RegExp((this.options.filterSubset?"":"^")+this.queryValue.escapeRegExp(),this.options.filterCase?"":"i"))},markQueryValue:function(a){if(!this.options.markQuery||!this.queryValue)return a;var b=new RegExp("("+(this.options.filterSubset?"":"^")+this.queryValue.escapeRegExp()+")",this.options.filterCase?"":"i");return a.replace(b,'<a class="autocompleter-queried">$1</a>')},addChoiceEvents:function(a){return a.addEvents({mouseover:this.choiceOver.bind(this,a),click:this.choiceSelect.bind(this,a)})}});var Observer=new Class({Implements:[Options,Events],options:{periodical:!1,delay:1e3},initialize:function(a,b,c){this.setOptions(c),this.addEvent("onFired",b),this.element=document.id(a)||$$(a),this.boundChange=this.changed.bind(this),this.resume()},changed:function(){var a=this.element.get("value");if($equals(this.value,a))return;this.clear(),this.value=a,this.timeout=this.onFired.delay(this.options.delay,this)},setValue:function(a){return this.value=a,this.element.set("value",a),this.clear()},onFired:function(){this.fireEvent("onFired",[this.value,this.element])},clear:function(){return clearTimeout(this.timeout||null),this},pause:function(){return clearTimeout(this.timeout),clearTimeout(this.timer),this.element.removeEvent("keyup",this.boundChange),this},resume:function(){return this.value=this.element.get("value"),this.options.periodical?this.timer=this.changed.periodical(this.options.periodical,this):this.element.addEvent("keyup",this.boundChange),this}}),$equals=function(a,b){return a==b||JSON.encode(a)==JSON.encode(b)};((function(){var a=new RegExp(/\@[^\s]{0,32}/g),b=new RegExp(/^\@[^\s]{0,32}$/);Autocompleter.Contacts=new Class({Extends:Autocompleter.Base,Implements:StyleWriter,options:{delay:100,allowDupes:!1,multiple:!1,selectMode:"pick",className:"ac-choices",css:".ac-choices {position: absolute;background: #fff;border: 1px solid #ccc;}\n.ac-choices {-webkit-box-shadow: 0 1px 5px rgba(0,0,0,.2);-moz-box-shadow: 0 1px 5px rgba(0,0,0,.2);box-shadow: 0 1px 5px rgba(0,0,0,.2);}\n.ac-choices li {padding: 3px 5px;cursor: pointer;white-space: nowrap;overflow: hidden;}\n.ac-choices li:hover {background: #f5f5f5;}\n.ac-choices li img {float: left;}\n.ac-choices li span {margin-left: 5px;line-height: 24px;}\n.ac-choices li span.ac-username {font-size: 14px;}\n.ac-choices li span.ac-urlname {color: #ccc;}\n.ac-choices li.autocompleter-selected {background: #f5f5f5;}\n.ac-choices li .autocompleter-queried {background: #d2f092;}\n",cssId:"autocompleter"},initialize:function(a,b){this.parent(a,b),this.options.injectChoice=this.injectChoice,this.createStyle(this.options.css,this.options.cssId),this.loadTokens()},loadTokens:function(){this.tokens||(app.req.user&&app.req.user.followings?this.tokens=app.req.user.followings:(new Request.JSON({url:"/"+app.req.user.urlname+"/following/",data:{limit:500,nopins:!0},onSuccess:function(a){this.tokens=a.users,app.req.user.followings=a.users}.bind(this)})).get())},query:function(){this.update(this.filter())},filter:function(){if(!this.tokens)return[];var a=this.queryForMatching();if(a=="")return this.tokens.clone();var b=new RegExp("^"+a.escapeRegExp(),"i"),c=this.tokens.filter(function(a){return b.test(a.username)});return c},queryForMatching:function(){return this.queryValue||""},valueForInput:function(a){return a.username},injectChoice:function(a){var b=(new Element("li")).adopt(new Element("img",{styles:{width:24,height:24},src:app.avatar(a)})).adopt((new Element("span",{"class":"ac-username"})).set("html",this.markQueryValue(a.username)));b.inputValue=this.valueForInput(a),this.addChoiceEvents(b).inject(this.choices)},markQueryValue:function(a){if(!this.options.markQuery||!this.queryValue)return a;var b=this.queryForMatching();if(!b)return a;var c=new RegExp("("+(this.options.filterSubset?"":"^")+b.escapeRegExp()+")",this.options.filterCase?"":"i");return a.replace(c,'<a class="autocompleter-queried">$1</a>')}}),Autocompleter.Contacts.At=new Class({Extends:Autocompleter.Contacts,options:{selectFirst:!0,allowDupes:!0,multiple:!0,separator:" "},prefetch:function(){var b=this.element.value,c=null,d=-1,e=b.match(a);if(e){var f=this.element.getCaretPosition(),g=b.substr(0,f).match(a);if(g){var h=g.length-1;d=f-g[h].length,b.substr(d,1)=="@"?c=e[h]:d=-1}}if(!c||c.length<this.options.minLength)this.hideChoices();else if(c===this.queryValue||this.visible&&c==this.selectedValue){if(this.visible)return!1;this.showChoices()}else this.queryValue=c,this.queryIndex=d,this.fetchCached()||this.query();return!0},queryForMatching:function(){return(this.queryValue||"@").substr(1)},valueForInput:function(a){var c="@"+a.username;return b.test(c)?c:"@"+a.username}})})).call(this)
				